Spaces:
Running
on
Zero
Running
on
Zero
Upload app.py
Browse files
app.py
CHANGED
@@ -90,8 +90,6 @@ def load_quantized_control(control_repo: str, dtype, hf_token):
|
|
90 |
return transformer, text_encoder_2
|
91 |
|
92 |
def load_pipeline(repo_id: str, cn_on: bool, model_type: str, task: str, dtype_str: str, hf_token: str, progress=gr.Progress(track_tqdm=True)):
|
93 |
-
pipe = None
|
94 |
-
pipe_i2i = None
|
95 |
try:
|
96 |
controlnet_model_union_repo = 'InstantX/FLUX.1-dev-Controlnet-Union'
|
97 |
if task == "Flux Fill" or repo_id in models_fill:
|
@@ -169,8 +167,8 @@ def change_base_model(repo_id: str, cn_on: bool, disable_model_cache: bool, mode
|
|
169 |
taef1.to("cpu")
|
170 |
if controlnet is not None: controlnet.to("cpu")
|
171 |
if controlnet_union is not None: controlnet_union.to("cpu")
|
|
|
172 |
clear_cache()
|
173 |
-
pipe, pipe_i2i = load_pipeline(repo_id, cn_on, model_type, task, dtype_str, HF_TOKEN, progress)
|
174 |
last_model = repo_id
|
175 |
last_cn_on = cn_on
|
176 |
last_task = task
|
|
|
90 |
return transformer, text_encoder_2
|
91 |
|
92 |
def load_pipeline(repo_id: str, cn_on: bool, model_type: str, task: str, dtype_str: str, hf_token: str, progress=gr.Progress(track_tqdm=True)):
|
|
|
|
|
93 |
try:
|
94 |
controlnet_model_union_repo = 'InstantX/FLUX.1-dev-Controlnet-Union'
|
95 |
if task == "Flux Fill" or repo_id in models_fill:
|
|
|
167 |
taef1.to("cpu")
|
168 |
if controlnet is not None: controlnet.to("cpu")
|
169 |
if controlnet_union is not None: controlnet_union.to("cpu")
|
170 |
+
pipe, pipe_i2i = load_pipeline(pipe, pipe_i2i, repo_id, cn_on, model_type, task, dtype_str, HF_TOKEN, progress)
|
171 |
clear_cache()
|
|
|
172 |
last_model = repo_id
|
173 |
last_cn_on = cn_on
|
174 |
last_task = task
|