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)