File size: 1,010 Bytes
c41ac46
e20e8da
c41ac46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import gradio as gr

# 加载模型
model = gr.load("models/black-forest-labs/FLUX.1-dev")

# 定义更多的示例
examples = [
    ["A beautiful sunset over a calm ocean"],
    ["A futuristic cityscape with flying cars"],
    ["A serene forest scene with a babbling brook"],
    ["An abstract representation of love with swirling colors"],
    ["A cat playing with a ball of yarn in a cozy living room"],
    ["A majestic mountain range under a starry night sky"],
    ["A bustling farmer's market with colorful produce"],
    ["A steampunk-inspired clockwork mechanism"],
    ["A tranquil Japanese garden with a koi pond"],
    ["A whimsical treehouse in an enchanted forest"]
]

# 创建新的接口,添加示例
demo = gr.Interface(
    fn=model.predict,
    inputs=model.input_components,
    outputs=model.output_components,
    examples=examples,
    title="FLUX.1 [dev] Image Generation",
    description="Enter a text prompt to generate an image using FLUX.1 [dev]."
)

# 启动应用
demo.launch()