Spaces:
Runtime error
Runtime error
File size: 621 Bytes
0a5bf53 8281fbe 3908e27 8281fbe 0a5bf53 8281fbe 0a5bf53 8281fbe 3ec475e 8281fbe |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import gradio as gr
from transformers import pipeline
# Load the model with remote code
pipe = pipeline("text-to-image", model="cloudqi/cqi_text_to_image_pt_v0", trust_remote_code=True)
def generate_image(prompt):
result = pipe(prompt)[0] # Get the first generated image
return result
# Create the Gradio interface
demo = gr.Interface(
fn=generate_image,
inputs=gr.Textbox(lines=2, placeholder="Enter your prompt here..."),
outputs="image",
title="Text-to-Image Generator",
description="Powered by cloudqi/cqi_text_to_image_pt_v0"
)
# Run with public link enabled
demo.launch(share=True)
|