Update app.py
Browse files
app.py
CHANGED
@@ -27,7 +27,7 @@ pipeline = StableDiffusion3Pipeline.from_pretrained(
|
|
27 |
lora_path = "lora_trained_model.safetensors" # Ensure this file is uploaded in the Space
|
28 |
if os.path.exists(lora_path):
|
29 |
try:
|
30 |
-
|
31 |
print("✅ LoRA weights loaded successfully!")
|
32 |
except Exception as e:
|
33 |
print(f"❌ Error loading LoRA: {e}")
|
@@ -65,3 +65,6 @@ with gr.Blocks() as demo:
|
|
65 |
output_image = gr.Image(label="Generated Image")
|
66 |
|
67 |
generate_btn.click(generate_image, inputs=[prompt_input, seed_input], outputs=output_image)
|
|
|
|
|
|
|
|
27 |
lora_path = "lora_trained_model.safetensors" # Ensure this file is uploaded in the Space
|
28 |
if os.path.exists(lora_path):
|
29 |
try:
|
30 |
+
pipeline.load_lora_weights(lora_path) # Use the correct method for loading LoRA weights
|
31 |
print("✅ LoRA weights loaded successfully!")
|
32 |
except Exception as e:
|
33 |
print(f"❌ Error loading LoRA: {e}")
|
|
|
65 |
output_image = gr.Image(label="Generated Image")
|
66 |
|
67 |
generate_btn.click(generate_image, inputs=[prompt_input, seed_input], outputs=output_image)
|
68 |
+
|
69 |
+
# Launch the Gradio app
|
70 |
+
demo.launch()
|