File size: 649 Bytes
12a106c
 
 
 
 
4d51d5a
12a106c
 
 
 
 
 
 
 
 
 
 
 
6b51d23
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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)