Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,22 +1,10 @@
|
|
1 |
import gradio as gr
|
2 |
import spaces
|
3 |
-
from diffusers import
|
4 |
import torch
|
5 |
|
6 |
-
|
7 |
-
|
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):
|