Spaces:
Running
on
Zero
Running
on
Zero
finish
Browse files
app.py
CHANGED
@@ -174,9 +174,6 @@ def run_flux(
|
|
174 |
seed_slicer = random.randint(0, MAX_SEED)
|
175 |
generator = torch.Generator().manual_seed(seed_slicer)
|
176 |
|
177 |
-
# pipe.enable_xformers_memory_efficient_attention()
|
178 |
-
|
179 |
-
|
180 |
with calculateDuration("run pipe"):
|
181 |
print("start to run pipe")
|
182 |
generated_image = pipe(
|
@@ -185,6 +182,7 @@ def run_flux(
|
|
185 |
mask_image=mask,
|
186 |
control_image=control_image,
|
187 |
control_mode=control_mode,
|
|
|
188 |
width=width,
|
189 |
height=height,
|
190 |
strength=strength_slider,
|
@@ -193,7 +191,7 @@ def run_flux(
|
|
193 |
max_sequence_length=256,
|
194 |
joint_attention_kwargs={"scale": lora_scale}
|
195 |
).images[0]
|
196 |
-
|
197 |
return generated_image
|
198 |
|
199 |
@spaces.GPU(duration=120)
|
@@ -334,7 +332,8 @@ def process(
|
|
334 |
final_images.append(control_image)
|
335 |
if generated_image:
|
336 |
final_images.append(generated_image)
|
337 |
-
|
|
|
338 |
return final_images, json.dumps(result)
|
339 |
|
340 |
|
|
|
174 |
seed_slicer = random.randint(0, MAX_SEED)
|
175 |
generator = torch.Generator().manual_seed(seed_slicer)
|
176 |
|
|
|
|
|
|
|
177 |
with calculateDuration("run pipe"):
|
178 |
print("start to run pipe")
|
179 |
generated_image = pipe(
|
|
|
182 |
mask_image=mask,
|
183 |
control_image=control_image,
|
184 |
control_mode=control_mode,
|
185 |
+
controlnet_conditioning_scale=0.85,
|
186 |
width=width,
|
187 |
height=height,
|
188 |
strength=strength_slider,
|
|
|
191 |
max_sequence_length=256,
|
192 |
joint_attention_kwargs={"scale": lora_scale}
|
193 |
).images[0]
|
194 |
+
progress(99, "Generate image success!")
|
195 |
return generated_image
|
196 |
|
197 |
@spaces.GPU(duration=120)
|
|
|
332 |
final_images.append(control_image)
|
333 |
if generated_image:
|
334 |
final_images.append(generated_image)
|
335 |
+
|
336 |
+
progress(100, "finish!")
|
337 |
return final_images, json.dumps(result)
|
338 |
|
339 |
|