fffiloni commited on
Commit
08c7296
1 Parent(s): 5b14616

Update injection_main.py

Browse files
Files changed (1) hide show
  1. injection_main.py +7 -1
injection_main.py CHANGED
@@ -331,7 +331,12 @@ def invert(
331
  progress_bar = tqdm(range(num_inference_steps - 1), total=num_inference_steps - 1, desc="DDIM Inversion")
332
 
333
  for i in progress_bar:
334
- i = int(i) # Explicitly convert i to int
 
 
 
 
 
335
  # We'll skip the final iteration
336
  if i >= num_inference_steps - 1:
337
  continue
@@ -378,6 +383,7 @@ def invert(
378
 
379
 
380
 
 
381
  def style_image_with_inversion(
382
  pipe,
383
  input_image,
 
331
  progress_bar = tqdm(range(num_inference_steps - 1), total=num_inference_steps - 1, desc="DDIM Inversion")
332
 
333
  for i in progress_bar:
334
+ print(f"Iteration type: {type(i)}, value: {i}") # Debugging statement
335
+ if isinstance(i, (int, float)):
336
+ i = int(i)
337
+ else:
338
+ raise TypeError(f"Unexpected type for iteration variable: {type(i)}")
339
+
340
  # We'll skip the final iteration
341
  if i >= num_inference_steps - 1:
342
  continue
 
383
 
384
 
385
 
386
+
387
  def style_image_with_inversion(
388
  pipe,
389
  input_image,