MegaTronX commited on
Commit
5bf8345
·
verified ·
1 Parent(s): dabf553

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -15
app.py CHANGED
@@ -1,22 +1,10 @@
1
  import gradio as gr
2
  import spaces
3
- from diffusers import FluxPipeline
4
  import torch
5
 
6
- # Replace with your actual model and LoRA paths
7
- BASE_MODEL = "black-forest-labs/FLUX-1-dev"
8
- LORA_MODEL = "MegaTronX/MetartLoRA" # Replace with your repo
9
-
10
- # Load base model pipeline
11
- pipe = FluxPipeline.from_pretrained(BASE_MODEL, torch_dtype=torch.float16)
12
-
13
- #pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-dev")
14
- #pipe.load_lora_weights("MegaTronX/MetartLoRA")
15
-
16
-
17
- # Load LoRA weights
18
- pipe.unet.load_attn_procs(LORA_MODEL)
19
- pipe = pipe.to("cuda")
20
 
21
  @spaces.GPU
22
  def generate_image(prompt, num_inference_steps=25, guidance_scale=7.5, seed=None):
 
1
  import gradio as gr
2
  import spaces
3
+ from diffusers import DiffusionPipeline
4
  import torch
5
 
6
+ pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-dev")
7
+ pipe.load_lora_weights("MegaTronX/MetartLoRA")
 
 
 
 
 
 
 
 
 
 
 
 
8
 
9
  @spaces.GPU
10
  def generate_image(prompt, num_inference_steps=25, guidance_scale=7.5, seed=None):