fffiloni commited on
Commit
5a109bc
·
verified ·
1 Parent(s): a7c772e

Update injection_main.py

Browse files
Files changed (1) hide show
  1. injection_main.py +6 -9
injection_main.py CHANGED
@@ -325,16 +325,13 @@ def invert(
325
  pipe.scheduler.set_timesteps(num_inference_steps, device=device)
326
 
327
  # Reversed timesteps <<<<<<<<<<<<<<<<<<<<
328
- timesteps = list(reversed(pipe.scheduler.timesteps))
329
 
330
- # Initialize tqdm progress bar
331
- for i in range(num_inference_steps - 1):
332
- print(f"Iteration type: {type(i)}, value: {i}") # Debugging statement
333
-
334
- if isinstance(i, (int, float)):
335
- i = int(i)
336
- else:
337
- raise TypeError(f"Unexpected type for iteration variable: {type(i)}")
338
 
339
  # We'll skip the final iteration
340
  if i >= num_inference_steps - 1:
 
325
  pipe.scheduler.set_timesteps(num_inference_steps, device=device)
326
 
327
  # Reversed timesteps <<<<<<<<<<<<<<<<<<<<
328
+ timesteps = reversed(pipe.scheduler.timesteps)
329
 
330
+ for i in progress.tqdm(
331
+ range(1, num_inference_steps),
332
+ total=num_inference_steps - 1,
333
+ desc="DDIM Inversion",
334
+ ):
 
 
 
335
 
336
  # We'll skip the final iteration
337
  if i >= num_inference_steps - 1: