Spaces:
Build error
Build error
| import gradio as gr | |
| import replicate | |
| # Authenticate with Replicate | |
| replicate.Client(api_token="r8_bf0m2SnfXi6m1YcVGuAxekbghbxVfE02qgTqV") | |
| # Define a function to use the model | |
| def generate_image(prompt): | |
| model = replicate.models.get("xarty8932/dream") | |
| version = model.versions.get("5e3c45aa9c9896f86634175309490225e5a379a6a81c39abbf55eab2cd16b657") | |
| output = version.predict(prompt=prompt) | |
| return output | |
| # Create a Gradio interface | |
| iface = gr.Interface(fn=generate_image, inputs="text", outputs="image") | |
| # Launch the interface | |
| iface.launch() | |