Update app-backup.py
Browse files- app-backup.py +4 -8
app-backup.py
CHANGED
@@ -16,7 +16,7 @@ from huggingface_hub import snapshot_download
|
|
16 |
import spaces
|
17 |
|
18 |
device = "cuda"
|
19 |
-
root_dir = os.
|
20 |
ckpt_dir = f'{root_dir}/weights/Kolors'
|
21 |
|
22 |
snapshot_download(repo_id="Kwai-Kolors/Kolors", local_dir=ckpt_dir)
|
@@ -48,9 +48,6 @@ pipe = StableDiffusionXLPipeline(
|
|
48 |
force_zeros_for_empty_prompt=False
|
49 |
).to(device)
|
50 |
|
51 |
-
#pipe = pipe.to(device)
|
52 |
-
#pipe.enable_model_cpu_offload()
|
53 |
-
|
54 |
if hasattr(pipe.unet, 'encoder_hid_proj'):
|
55 |
pipe.unet.text_encoder_hid_proj = pipe.unet.encoder_hid_proj
|
56 |
|
@@ -175,7 +172,7 @@ with gr.Blocks(css=css) as demo:
|
|
175 |
minimum=1,
|
176 |
maximum=100,
|
177 |
step=1,
|
178 |
-
value=
|
179 |
)
|
180 |
|
181 |
gr.Examples(
|
@@ -193,6 +190,5 @@ with gr.Blocks(css=css) as demo:
|
|
193 |
outputs=[result, seed]
|
194 |
)
|
195 |
|
196 |
-
#
|
197 |
-
demo.launch()
|
198 |
-
|
|
|
16 |
import spaces
|
17 |
|
18 |
device = "cuda"
|
19 |
+
root_dir = os.getcwd()
|
20 |
ckpt_dir = f'{root_dir}/weights/Kolors'
|
21 |
|
22 |
snapshot_download(repo_id="Kwai-Kolors/Kolors", local_dir=ckpt_dir)
|
|
|
48 |
force_zeros_for_empty_prompt=False
|
49 |
).to(device)
|
50 |
|
|
|
|
|
|
|
51 |
if hasattr(pipe.unet, 'encoder_hid_proj'):
|
52 |
pipe.unet.text_encoder_hid_proj = pipe.unet.encoder_hid_proj
|
53 |
|
|
|
172 |
minimum=1,
|
173 |
maximum=100,
|
174 |
step=1,
|
175 |
+
value=50,
|
176 |
)
|
177 |
|
178 |
gr.Examples(
|
|
|
190 |
outputs=[result, seed]
|
191 |
)
|
192 |
|
193 |
+
# Launch the app
|
194 |
+
demo.launch(share=True)
|
|