import gradio as gr from huggingface_hub import InferenceClient import random css=""" #col-container { margin: 0 auto; max-width: 530px; } """ client_sd3 = InferenceClient("stabilityai/stable-diffusion-3-medium-diffusers") def sd3_seed(prompt): seed = random.randint(0, 999999) image = client_sd3.text_to_image(prompt, negative_prompt=f"{seed}") return gr.Image(image) demo = gr.Interface( fn=sd3_seed, inputs=gr.Textbox(lines=2, placeholder="Enter an image generation prompt..."), outputs="image", title="SD3 CLI", examples=[ "an illustration of a wiener schnitzel", "cold coffee in a cup bokeh --ar 85:128 --stylev", "a delicious ceviche cheesecake slice, ultra-hd+", ], cache_examples=True, css=css, theme="bethecloud/storj_theme", ) demo.launch()