Spaces:
Runtime error

Keeps / App. Py
Sha77755's picture
Create App. Py
2a644fe verified
Raw History Blame Contribute Delete
568 Bytes
import gradio as gr
from transformers import pipeline
# Text-to-image pipeline initialize karna
pipe = pipeline("text-to-image-generation", model="dalle-mini/dalle-mini")
def generate_image(text):
# Text se image generate karna
result = pipe(text)
return result[0]["generated_image"]
# Gradio Interface banana
iface = gr.Interface(
fn=generate_image,
inputs="text",
outputs="image",
title="Text-to-Image Generator",
description="Enter a description, and this AI will generate an image based on it."
)
# Launch the app
iface.launch()