Update app.py
Browse files
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
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
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:
|