Spaces:
Build error
Build error
File size: 560 Bytes
3593d15 8a7f664 3593d15 8a7f664 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
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()
|