Yaquv ferrymangmi commited on
Commit
05eb1bc
·
verified ·
1 Parent(s): 88b96ff

debug: base model + output management (#2)

Browse files

- debug: base model + output management (7f98d3f3499728559c1602b3c40e2e9c433682e7)


Co-authored-by: Mehdi Merabet <[email protected]>

Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -1,14 +1,17 @@
1
  import gradio as gr
2
  from diffusers import DiffusionPipeline
3
 
4
- # Load the model
5
- pipe = DiffusionPipeline.from_pretrained("Yaquv/rick")
 
6
 
7
- # Define a prediction function to handle the output
 
 
 
8
  def predict(text):
9
- output = pipe(text) # Run the model with the text input
10
- # Assuming the output is a tuple and the image is the first element
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