Spaces:
Runtime error
Runtime error
debug: base model + output management (#2)
Browse files- debug: base model + output management (7f98d3f3499728559c1602b3c40e2e9c433682e7)
Co-authored-by: Mehdi Merabet <[email protected]>
app.py
CHANGED
@@ -1,14 +1,17 @@
|
|
1 |
import gradio as gr
|
2 |
from diffusers import DiffusionPipeline
|
3 |
|
4 |
-
# Load the model
|
5 |
-
|
|
|
6 |
|
7 |
-
#
|
|
|
|
|
|
|
8 |
def predict(text):
|
9 |
-
output = pipe(text)
|
10 |
-
|
11 |
-
image = output[0]
|
12 |
return image
|
13 |
|
14 |
# Create a Gradio interface
|
|
|
1 |
import gradio as gr
|
2 |
from diffusers import DiffusionPipeline
|
3 |
|
4 |
+
# Load the base model
|
5 |
+
base_model = "black-forest-labs/FLUX.1-dev"
|
6 |
+
pipe = DiffusionPipeline.from_pretrained(base_model)
|
7 |
|
8 |
+
# Load the LoRA weights from your repository
|
9 |
+
pipe.load_lora_weights("Yaquv/rick", weight_name="rick.safetensors")
|
10 |
+
|
11 |
+
# Define a prediction function
|
12 |
def predict(text):
|
13 |
+
output = pipe(text)
|
14 |
+
image = output.images[0] # Extract the first image from the output
|
|
|
15 |
return image
|
16 |
|
17 |
# Create a Gradio interface
|