DoomSlayer9743/Text-to-image
0
1# app.py2from diffusers import DiffusionPipeline3import gradio as gr4 5# Initialize the diffusion pipeline6pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-3.5-large")7 8# Define the image generation function9def generate_image(prompt):10 image = pipe(prompt).images[0]11 return image12 13# Set up the Gradio interface14interface = gr.Interface(15 fn=generate_image,16 inputs="text",17 outputs="image",18 title="Image Generation with Stable Diffusion",19 description="Enter a prompt, and this app will generate an image based on the Stable Diffusion model."20)21 22# Launch the app23if __name__ == "__main__":24 interface.launch()25 