Spaces:
Runtime error
Runtime error
File size: 695 Bytes
ff7f8d1 88b96ff ff7f8d1 05eb1bc 88b96ff 05eb1bc 88b96ff 05eb1bc 88b96ff | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | import gradio as gr
from diffusers import DiffusionPipeline
# Load the base model
base_model = "black-forest-labs/FLUX.1-dev"
pipe = DiffusionPipeline.from_pretrained(base_model)
# Load the LoRA weights from your repository
pipe.load_lora_weights("Yaquv/rick", weight_name="rick.safetensors")
# Define a prediction function
def predict(text):
output = pipe(text)
image = output.images[0] # Extract the first image from the output
return image
# Create a Gradio interface
iface = gr.Interface(
fn=predict, # The prediction function
inputs="text", # Text input for the prompt
outputs="image" # Expecting an image output
)
# Launch the app
iface.launch() |