Keltezaa commited on
Commit
d251b4b
·
verified ·
1 Parent(s): d44dd5e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -20
app.py CHANGED
@@ -553,33 +553,19 @@ def run_lora(prompt, cfg_scale, steps, selected_info_1, selected_info_2, selecte
553
  progress_bar = f'<div class="progress-container"><div class="progress-bar" style="--current: {step_counter}; --total: {steps};"></div></div>'
554
  yield image, seed, gr.update(value=progress_bar, visible=True)
555
 
556
- if image_input is not None:
557
- final_image = generate_image_to_image(prompt_mash, image_input, image_strength, steps, cfg_scale, width, height, seed)
558
- print(f"Debug: generate_image_to_image output type: {type(final_image)}") # Debugging
559
- if not isinstance(final_image, (PIL.Image.Image, torch.Tensor)): # Check if it's an image
560
- print(f"Error: Expected an image, but got {type(final_image)}")
561
- raise ValueError("Expected an image from generate_image_to_image, but got a non-image value.")
562
- print(f"Debug: generate_image_to_image output value: {final_image}") # Debugging
563
- yield final_image, seed, gr.update(visible=False)
564
-
565
- if final_image is None:
566
- print("No final image generated.") # Debugging statement
567
- else:
568
- print(f"Debug: final_image type: {type(final_image)}") # Debugging
569
- if not isinstance(final_image, (PIL.Image.Image, torch.Tensor)): # Check if it's an image
570
- print(f"Error: Expected an image, but got {type(final_image)}")
571
- raise ValueError("Expected an image, but got a non-image value.")
572
- print(f"Debug: final_image value: {final_image}") # Debugging
573
-
574
- yield final_image, seed, gr.update(value=progress_bar, visible=False)
575
 
576
-
577
  except Exception as e:
578
  print(f"Error during image generation: {e}") # Error handling
579
  raise gr.Error("An error occurred during image generation.")
580
 
581
  run_lora.zerogpu = True
582
 
 
583
  def get_huggingface_safetensors(link):
584
  split_link = link.split("/")
585
  if len(split_link) == 4:
 
553
  progress_bar = f'<div class="progress-container"><div class="progress-bar" style="--current: {step_counter}; --total: {steps};"></div></div>'
554
  yield image, seed, gr.update(value=progress_bar, visible=True)
555
 
556
+ if final_image is None:
557
+ print("No final image generated.") # Debugging statement
558
+ else:
559
+ print(f"Debug: final_image type: {type(final_image)}") # Debugging
560
+ yield final_image, seed, gr.update(value=progress_bar, visible=False)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
561
 
 
562
  except Exception as e:
563
  print(f"Error during image generation: {e}") # Error handling
564
  raise gr.Error("An error occurred during image generation.")
565
 
566
  run_lora.zerogpu = True
567
 
568
+
569
  def get_huggingface_safetensors(link):
570
  split_link = link.split("/")
571
  if len(split_link) == 4: