Spaces:
Running
on
Zero
Running
on
Zero
app
Browse files
app.py
CHANGED
@@ -23,11 +23,16 @@ from transformers import BlipProcessor, BlipForConditionalGeneration
|
|
23 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
24 |
|
25 |
import os
|
26 |
-
os.system("git lfs install")
|
27 |
-
os.system("git clone https://huggingface.co/h94/IP-Adapter")
|
28 |
-
os.system("mv IP-Adapter/sdxl_models sdxl_models")
|
29 |
-
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
31 |
image_encoder_path = "sdxl_models/image_encoder"
|
32 |
csgo_ckpt ='./CSGO/csgo_4_32.bin'
|
33 |
pretrained_vae_name_or_path ='madebyollin/sdxl-vae-fp16-fix'
|
@@ -42,8 +47,8 @@ os.system('rm -rf TTPLanet_SDXL_Controlnet_Tile_Realistic/TTPLANET_Controlnet_Ti
|
|
42 |
controlnet_path = "./TTPLanet_SDXL_Controlnet_Tile_Realistic"
|
43 |
|
44 |
|
45 |
-
os.system('git clone https://huggingface.co/InstantX/CSGO')
|
46 |
-
os.system('rm -rf CSGO/csgo.bin')
|
47 |
|
48 |
|
49 |
|
@@ -151,7 +156,7 @@ def image_grid(imgs, rows, cols):
|
|
151 |
for i, img in enumerate(imgs):
|
152 |
grid.paste(img, box=(i % cols * w, i // cols * h))
|
153 |
return grid
|
154 |
-
@spaces.GPU(enable_queue=True,duration=
|
155 |
def create_image(content_image_pil,
|
156 |
style_image_pil,
|
157 |
prompt,
|
|
|
23 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
24 |
|
25 |
import os
|
26 |
+
# os.system("git lfs install")
|
27 |
+
# os.system("git clone https://huggingface.co/h94/IP-Adapter")
|
28 |
+
# os.system("mv IP-Adapter/sdxl_models sdxl_models")
|
29 |
+
|
30 |
+
from huggingface_hub import hf_hub_download
|
31 |
+
|
32 |
+
hf_hub_download(repo_id="h94/IP-Adapter", filename="sdxl_models/image_encoder", local_dir="./sdxl_models/image_encoder")
|
33 |
+
hf_hub_download(repo_id="InstantX/CSGO", filename="csgo_4_32.bin", local_dir="./CSGO/csgo_4_32.bin")
|
34 |
+
# os.system('rm -rf IP-Adapter/models')
|
35 |
+
base_model_path = "stabilityai/stable-diffusion-xl-base-1.0"
|
36 |
image_encoder_path = "sdxl_models/image_encoder"
|
37 |
csgo_ckpt ='./CSGO/csgo_4_32.bin'
|
38 |
pretrained_vae_name_or_path ='madebyollin/sdxl-vae-fp16-fix'
|
|
|
47 |
controlnet_path = "./TTPLanet_SDXL_Controlnet_Tile_Realistic"
|
48 |
|
49 |
|
50 |
+
# os.system('git clone https://huggingface.co/InstantX/CSGO')
|
51 |
+
# os.system('rm -rf CSGO/csgo.bin')
|
52 |
|
53 |
|
54 |
|
|
|
156 |
for i, img in enumerate(imgs):
|
157 |
grid.paste(img, box=(i % cols * w, i // cols * h))
|
158 |
return grid
|
159 |
+
@spaces.GPU(enable_queue=True,duration=500)
|
160 |
def create_image(content_image_pil,
|
161 |
style_image_pil,
|
162 |
prompt,
|