DonImages commited on
Commit
ee8ab11
·
verified ·
1 Parent(s): 94d851c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
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
- SD3LoraLoaderMixin.load_lora_into_model(pipeline, lora_path)
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()