Spaces:
Running
on
Zero
Running
on
Zero
RageshAntony
commited on
kand spe
Browse files
app.py
CHANGED
@@ -58,11 +58,11 @@ MODEL_CONFIGS = {
|
|
58 |
"pipeline_class": AuraFlowPipeline,
|
59 |
#"cache_dir" : cache_dir
|
60 |
},
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
"Hunyuan": {
|
67 |
"repo_id": "Tencent-Hunyuan/HunyuanDiT-Diffusers",
|
68 |
"pipeline_class": HunyuanDiTPipeline,
|
@@ -150,11 +150,19 @@ def load_pipeline(model_name):
|
|
150 |
initial_memory = get_process_memory()
|
151 |
config = MODEL_CONFIGS[model_name]
|
152 |
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
pipe = pipe.to(DEVICE)
|
159 |
|
160 |
if hasattr(pipe, 'enable_model_cpu_offload'):
|
|
|
58 |
"pipeline_class": AuraFlowPipeline,
|
59 |
#"cache_dir" : cache_dir
|
60 |
},
|
61 |
+
"Kandinsky": {
|
62 |
+
"repo_id": "kandinsky-community/kandinsky-3",
|
63 |
+
"pipeline_class": Kandinsky3Pipeline,
|
64 |
+
#"cache_dir" : cache_dir
|
65 |
+
},
|
66 |
"Hunyuan": {
|
67 |
"repo_id": "Tencent-Hunyuan/HunyuanDiT-Diffusers",
|
68 |
"pipeline_class": HunyuanDiTPipeline,
|
|
|
150 |
initial_memory = get_process_memory()
|
151 |
config = MODEL_CONFIGS[model_name]
|
152 |
|
153 |
+
|
154 |
+
pipe = None
|
155 |
+
if model_name == "Kandinsky":
|
156 |
+
print("Kandinsky Special")
|
157 |
+
pipe = AutoPipelineForText2Image.from_pretrained(
|
158 |
+
"kandinsky-community/kandinsky-3", variant="fp16", torch_dtype=torch.float16
|
159 |
+
)
|
160 |
+
else:
|
161 |
+
pipe = config["pipeline_class"].from_pretrained(
|
162 |
+
config["repo_id"],
|
163 |
+
torch_dtype=TORCH_DTYPE,
|
164 |
+
# cache_dir=cache_dir
|
165 |
+
)
|
166 |
pipe = pipe.to(DEVICE)
|
167 |
|
168 |
if hasattr(pipe, 'enable_model_cpu_offload'):
|