ainz commited on
Commit
c3e951e
·
verified ·
1 Parent(s): d96a32b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -1
app.py CHANGED
@@ -1,3 +1,35 @@
 
1
  import gradio as gr
 
2
 
3
- gr.load("models/ostris/Flex.1-alpha"), headers={"X-IP-Token": x_ip_token}.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
  import gradio as gr
3
+ from huggingface_hub import login
4
 
5
+ # Gradio demo definition
6
+ def create_demo():
7
+ with gr.Blocks() as demo:
8
+ gr.Markdown("# Flex.1-alpha Text to Image Generation")
9
+
10
+ with gr.Row():
11
+ with gr.Column():
12
+ prompt = gr.Textbox(label="Prompt", placeholder="Enter your prompt here...")
13
+ negative_prompt = gr.Textbox(label="Negative Prompt", placeholder="What you don't want to see in the image...")
14
+
15
+ with gr.Row():
16
+ generate = gr.Button("Generate")
17
+ clear = gr.Button("Clear")
18
+
19
+ with gr.Column():
20
+ result = gr.Image(label="Generated Image")
21
+
22
+ # Since this is a zero GPU demo, we'll show a message about the model's unavailability
23
+ generate.click(
24
+ fn=lambda x, y: gr.Info("This is a zero GPU demo. The model cannot generate images without GPU resources.").value,
25
+ inputs=[prompt, negative_prompt],
26
+ outputs=result
27
+ )
28
+ clear.click(lambda: ["", ""], outputs=[prompt, negative_prompt])
29
+
30
+ return demo
31
+
32
+ # Create and launch the demo
33
+ if __name__ == "__main__":
34
+ demo = create_demo()
35
+ demo.launch()