RageshAntony commited on
Commit
42303d1
·
verified ·
1 Parent(s): 08e45e0
Files changed (1) hide show
  1. app.py +18 -10
app.py CHANGED
@@ -58,11 +58,11 @@ MODEL_CONFIGS = {
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,11 +150,19 @@ def load_pipeline(model_name):
150
  initial_memory = get_process_memory()
151
  config = MODEL_CONFIGS[model_name]
152
 
153
- pipe = config["pipeline_class"].from_pretrained(
154
- config["repo_id"],
155
- torch_dtype=TORCH_DTYPE,
156
- #cache_dir=cache_dir
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'):