Spaces:
Runtime error
Runtime error
lixiang46
commited on
Commit
·
ae6a57b
1
Parent(s):
6ef1dc4
update
Browse files- app.py +7 -5
- kolors/__pycache__/__init__.cpython-38.pyc +0 -0
- kolors/models/__pycache__/__init__.cpython-38.pyc +0 -0
- kolors/models/__pycache__/configuration_chatglm.cpython-38.pyc +0 -0
- kolors/models/__pycache__/modeling_chatglm.cpython-38.pyc +0 -0
- kolors/models/__pycache__/tokenization_chatglm.cpython-38.pyc +0 -0
- kolors/models/__pycache__/unet_2d_condition.cpython-38.pyc +0 -0
- kolors/pipelines/__pycache__/__init__.cpython-38.pyc +0 -0
- kolors/pipelines/__pycache__/pipeline_stable_diffusion_xl_chatglm_256_ipadapter.cpython-38.pyc +0 -0
app.py
CHANGED
|
@@ -12,8 +12,11 @@ import gradio as gr
|
|
| 12 |
import numpy as np
|
| 13 |
|
| 14 |
device = "cuda"
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
# Load models
|
| 19 |
text_encoder = ChatGLMModel.from_pretrained(f'{ckpt_dir}/text_encoder', torch_dtype=torch.float16).half().to(device)
|
|
@@ -60,8 +63,7 @@ def infer(prompt, ip_adapter_image, ip_adapter_scale, negative_prompt, seed, ran
|
|
| 60 |
num_inference_steps=num_inference_steps,
|
| 61 |
guidance_scale=guidance_scale,
|
| 62 |
num_images_per_prompt=1,
|
| 63 |
-
generator=generator
|
| 64 |
-
image_encoder=image_encoder,
|
| 65 |
).images[0]
|
| 66 |
|
| 67 |
return image
|
|
@@ -173,4 +175,4 @@ with gr.Blocks(css=css) as demo:
|
|
| 173 |
outputs = [result]
|
| 174 |
)
|
| 175 |
|
| 176 |
-
demo.queue().launch()
|
|
|
|
| 12 |
import numpy as np
|
| 13 |
|
| 14 |
device = "cuda"
|
| 15 |
+
device = "cuda"
|
| 16 |
+
ckpt_dir = '/home/lixiang46/Kolors/weights/Kolors'
|
| 17 |
+
ckpt_IPA_dir = '/home/lixiang46/Kolors/weights/Kolors-IP-Adapter-Plus'
|
| 18 |
+
# ckpt_dir = snapshot_download(repo_id="Kwai-Kolors/Kolors")
|
| 19 |
+
# ckpt_IPA_dir = snapshot_download(repo_id="Kwai-Kolors/Kolors-IP-Adapter-Plus")
|
| 20 |
|
| 21 |
# Load models
|
| 22 |
text_encoder = ChatGLMModel.from_pretrained(f'{ckpt_dir}/text_encoder', torch_dtype=torch.float16).half().to(device)
|
|
|
|
| 63 |
num_inference_steps=num_inference_steps,
|
| 64 |
guidance_scale=guidance_scale,
|
| 65 |
num_images_per_prompt=1,
|
| 66 |
+
generator=generator
|
|
|
|
| 67 |
).images[0]
|
| 68 |
|
| 69 |
return image
|
|
|
|
| 175 |
outputs = [result]
|
| 176 |
)
|
| 177 |
|
| 178 |
+
demo.queue().launch(share=True)
|
kolors/__pycache__/__init__.cpython-38.pyc
ADDED
|
Binary file (151 Bytes). View file
|
|
|
kolors/models/__pycache__/__init__.cpython-38.pyc
ADDED
|
Binary file (158 Bytes). View file
|
|
|
kolors/models/__pycache__/configuration_chatglm.cpython-38.pyc
ADDED
|
Binary file (1.62 kB). View file
|
|
|
kolors/models/__pycache__/modeling_chatglm.cpython-38.pyc
ADDED
|
Binary file (33.6 kB). View file
|
|
|
kolors/models/__pycache__/tokenization_chatglm.cpython-38.pyc
ADDED
|
Binary file (11.5 kB). View file
|
|
|
kolors/models/__pycache__/unet_2d_condition.cpython-38.pyc
ADDED
|
Binary file (40.3 kB). View file
|
|
|
kolors/pipelines/__pycache__/__init__.cpython-38.pyc
ADDED
|
Binary file (161 Bytes). View file
|
|
|
kolors/pipelines/__pycache__/pipeline_stable_diffusion_xl_chatglm_256_ipadapter.cpython-38.pyc
ADDED
|
Binary file (30.3 kB). View file
|
|
|