import gradio as gr from models import generate_image, MODEL_ID from config import APPLE_TENCENT_THEME def create_ui(): with gr.Blocks(title=f"Tencent HunyuanImage-3.0 Demo", theme=APPLE_TENCENT_THEME) as demo: gr.HTML( f"
" f"

Tencent {MODEL_ID.split('/')[-1]}

" f"

Generate images using Tencent's state-of-the-art model hosted by FAL AI.

" f"Built with anycoder" f"
" ) with gr.Row(): with gr.Column(scale=1): prompt_input = gr.Textbox( label="Prompt", placeholder="e.g., A detailed watercolor painting of a small red fox sleeping on a pile of autumn leaves.", lines=4 ) generate_btn = gr.Button("🎨 Generate Image", variant="primary") with gr.Column(scale=1): output_image = gr.Image( label="Generated Image", height=512, width=512, interactive=False, show_download_button=True ) # Set up the event listener with all queue-related features disabled generate_btn.click( fn=generate_image, inputs=[prompt_input], outputs=[output_image], queue=False, # Disable queue for this event api_name=False, # Disable API endpoint creation show_api=False, # Don't show this in API docs ) # Example usage guidance with queue features disabled gr.Examples( examples=[ "A detailed watercolor painting of a small red fox sleeping on a pile of autumn leaves." ], inputs=prompt_input, outputs=output_image, fn=generate_image, cache_examples=False, # Don't cache examples api_name=False, # No API endpoint for examples show_api=False, # Don't show in API docs ) return demo if __name__ == "__main__": app = create_ui() # Launch without queue, API, and monitoring features app.launch( show_api=False, # Hide API documentation enable_monitoring=False, # Disable monitoring to prevent any background queuing quiet=True, # Reduce console output )