Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| from diffusers import DiffusionPipeline | |
| # Load the model | |
| pipe = DiffusionPipeline.from_pretrained("Yaquv/rick") | |
| # Define a prediction function to handle the output | |
| def predict(text): | |
| output = pipe(text) # Run the model with the text input | |
| # Assuming the output is a tuple and the image is the first element | |
| image = output[0] | |
| 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() |