Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,6 +26,7 @@ def interrupt_callback(pipe, step, timestep, callback_kwargs):
|
|
| 26 |
global cancel_txt2img, cancel_img2img
|
| 27 |
if (pipe == pipe_txt2img and cancel_txt2img) or (pipe == pipe_img2img and cancel_img2img):
|
| 28 |
pipe._interrupt = True # Stoppt die Pipeline
|
|
|
|
| 29 |
return callback_kwargs
|
| 30 |
|
| 31 |
# === GESICHTSMASKEN-FUNKTIONEN ===
|
|
@@ -129,7 +130,7 @@ def text_to_image(prompt, steps, guidance_scale):
|
|
| 129 |
if current_txt2img_task_id is not None:
|
| 130 |
print(f"🛑 Cancel vorheriger Text-to-Image Task (ID: {current_txt2img_task_id})")
|
| 131 |
cancel_txt2img = True
|
| 132 |
-
time.sleep(0.
|
| 133 |
|
| 134 |
current_txt2img_task_id = task_id
|
| 135 |
cancel_txt2img = False
|
|
@@ -181,7 +182,7 @@ def img_to_image(image, prompt, neg_prompt, strength, steps, guidance_scale, fac
|
|
| 181 |
if current_img2img_task_id is not None:
|
| 182 |
print(f"🛑 Cancel vorheriger Image-to-Image Task (ID: {current_img2img_task_id})")
|
| 183 |
cancel_img2img = True
|
| 184 |
-
time.sleep(0.
|
| 185 |
|
| 186 |
current_img2img_task_id = task_id
|
| 187 |
cancel_img2img = False
|
|
|
|
| 26 |
global cancel_txt2img, cancel_img2img
|
| 27 |
if (pipe == pipe_txt2img and cancel_txt2img) or (pipe == pipe_img2img and cancel_img2img):
|
| 28 |
pipe._interrupt = True # Stoppt die Pipeline
|
| 29 |
+
print(f"🛑 Interrupt ausgelöst für Pipeline (Step: {step})")
|
| 30 |
return callback_kwargs
|
| 31 |
|
| 32 |
# === GESICHTSMASKEN-FUNKTIONEN ===
|
|
|
|
| 130 |
if current_txt2img_task_id is not None:
|
| 131 |
print(f"🛑 Cancel vorheriger Text-to-Image Task (ID: {current_txt2img_task_id})")
|
| 132 |
cancel_txt2img = True
|
| 133 |
+
time.sleep(0.5) # Längere Pause für CPU
|
| 134 |
|
| 135 |
current_txt2img_task_id = task_id
|
| 136 |
cancel_txt2img = False
|
|
|
|
| 182 |
if current_img2img_task_id is not None:
|
| 183 |
print(f"🛑 Cancel vorheriger Image-to-Image Task (ID: {current_img2img_task_id})")
|
| 184 |
cancel_img2img = True
|
| 185 |
+
time.sleep(0.5) # Längere Pause für CPU
|
| 186 |
|
| 187 |
current_img2img_task_id = task_id
|
| 188 |
cancel_img2img = False
|