Text-to-image / app.py
koesterbenjamin's picture
Update app.py
4d51d5a verified
raw
history blame contribute delete
649 Bytes
import gradio as gr
from huggingface_hub import InferenceClient
def imageGen(prompt):
model_name='https://api-inference.huggingface.co/models/black-forest-labs/FLUX.1-dev'
client = InferenceClient(model=model_name)
output=client.text_to_image(prompt)
return output
with gr.Blocks(theme=gr.themes.Citrus()) as demo:
with gr.Row():
with gr.Column():
prompt= gr.Textbox(label="Prompt",scale=1)
describe_btn = gr.Button("Generate Image",scale=1)
with gr.Column():
image=gr.Image(type='pil', label='your image')
describe_btn.click(fn=imageGen, inputs=prompt, outputs=image)
demo.launch(debug=True, share=True)