Rooc commited on
Commit
c41ac46
·
verified ·
1 Parent(s): dc0e781

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +30 -15
app.py CHANGED
@@ -1,16 +1,31 @@
1
- import gradio as gr
2
 
3
- gr.load("models/black-forest-labs/FLUX.1-dev").launch(
4
- examples=[
5
- ["A beautiful sunset over a calm ocean"],
6
- ["A futuristic cityscape with flying cars"],
7
- ["A serene forest scene with a babbling brook"],
8
- ["An abstract representation of love with swirling colors"],
9
- ["A cat playing with a ball of yarn in a cozy living room"],
10
- ["A majestic mountain range under a starry night sky"],
11
- ["A bustling farmer's market with colorful produce"],
12
- ["A steampunk-inspired clockwork mechanism"],
13
- ["A tranquil Japanese garden with a koi pond"],
14
- ["A whimsical treehouse in an enchanted forest"]
15
- ]
16
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
 
3
+ # 加载模型
4
+ model = gr.load("models/black-forest-labs/FLUX.1-dev")
5
+
6
+ # 定义更多的示例
7
+ examples = [
8
+ ["A beautiful sunset over a calm ocean"],
9
+ ["A futuristic cityscape with flying cars"],
10
+ ["A serene forest scene with a babbling brook"],
11
+ ["An abstract representation of love with swirling colors"],
12
+ ["A cat playing with a ball of yarn in a cozy living room"],
13
+ ["A majestic mountain range under a starry night sky"],
14
+ ["A bustling farmer's market with colorful produce"],
15
+ ["A steampunk-inspired clockwork mechanism"],
16
+ ["A tranquil Japanese garden with a koi pond"],
17
+ ["A whimsical treehouse in an enchanted forest"]
18
+ ]
19
+
20
+ # 创建新的接口,添加示例
21
+ demo = gr.Interface(
22
+ fn=model.predict,
23
+ inputs=model.input_components,
24
+ outputs=model.output_components,
25
+ examples=examples,
26
+ title="FLUX.1 [dev] Image Generation",
27
+ description="Enter a text prompt to generate an image using FLUX.1 [dev]."
28
+ )
29
+
30
+ # 启动应用
31
+ demo.launch()