Spaces:
Runtime error
Runtime error
| 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() |