Astridkraft commited on
Commit
d7e835a
·
verified ·
1 Parent(s): 2a6047b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -1
app.py CHANGED
@@ -216,8 +216,22 @@ def img_to_image(image, prompt, neg_prompt, strength, steps, guidance_scale, fac
216
  print("Keine gültigen Koordinaten - keine Maske angewendet")
217
  mask = None
218
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
219
  # Progress Callback hinzufügen
220
- callback = ProgressCallback(progress, int(steps))
221
 
222
  # --- PIPELINE-AUFRUF ---
223
  result = pipe(
 
216
  print("Keine gültigen Koordinaten - keine Maske angewendet")
217
  mask = None
218
 
219
+ #Berechnung echte Schritte für steps da Scheduler sie anhand von strength-Wert selbst berechnet (steps-Wert ist für ihn unwichtig)
220
+ steps = int(steps)
221
+ adj_strength = min(0.85, strength * 1.3)
222
+
223
+ # 1. Pipeline VORBEREITEN (ohne Aufruf)
224
+ pipe.scheduler.set_timesteps(steps) # forciert steps
225
+
226
+ # 2. Echte Timesteps holen
227
+ actual_timesteps = len(pipe.scheduler.timesteps)
228
+ print(f"ECHTE SCHRITTE: {actual_timesteps}")
229
+
230
+ # 3. Callback mit echter Zahl
231
+ callback = ProgressCallback(progress, actual_timesteps)
232
+
233
  # Progress Callback hinzufügen
234
+ #callback = ProgressCallback(progress, int(steps))
235
 
236
  # --- PIPELINE-AUFRUF ---
237
  result = pipe(