Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,7 +9,7 @@ import spaces
|
|
| 9 |
dtype = torch.bfloat16
|
| 10 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 11 |
|
| 12 |
-
# ๋ชจ๋ธ ๋ก๋
|
| 13 |
pipe = DiffusionPipeline.from_pretrained(
|
| 14 |
"black-forest-labs/FLUX.1-schnell",
|
| 15 |
torch_dtype=dtype
|
|
@@ -18,236 +18,197 @@ pipe = DiffusionPipeline.from_pretrained(
|
|
| 18 |
MAX_SEED = np.iinfo(np.int32).max
|
| 19 |
MAX_IMAGE_SIZE = 2048
|
| 20 |
|
| 21 |
-
# ์ ํ ๋์์ธ ์ปจ์
์์
|
| 22 |
-
EXAMPLES = [
|
| 23 |
-
{
|
| 24 |
-
"title": "Smart Coffee Machine",
|
| 25 |
-
"prompt": """A sleek industrial design concept for a coffee machine:
|
| 26 |
-
- Curved metallic body with minimal bezel
|
| 27 |
-
- Touchscreen panel for settings
|
| 28 |
-
- Modern matte black finish
|
| 29 |
-
- Hand-drawn concept sketch style""",
|
| 30 |
-
"width": 1024,
|
| 31 |
-
"height": 1024
|
| 32 |
-
},
|
| 33 |
-
{
|
| 34 |
-
"title": "AI Speaker",
|
| 35 |
-
"prompt": """A futuristic AI speaker concept:
|
| 36 |
-
- Cylindrical shape with LED ring near top
|
| 37 |
-
- Voice assistant concept, floating panel controls
|
| 38 |
-
- Smooth glossy finish with minimal seams
|
| 39 |
-
- Techy, modern look in grayscale""",
|
| 40 |
-
"width": 1024,
|
| 41 |
-
"height": 1024
|
| 42 |
-
},
|
| 43 |
-
{
|
| 44 |
-
"title": "Next-Gen Smartphone",
|
| 45 |
-
"prompt": """A wireframe-style concept for a bezel-less smartphone:
|
| 46 |
-
- Edge-to-edge display
|
| 47 |
-
- Integrated camera under screen
|
| 48 |
-
- Metallic frame, minimal ports
|
| 49 |
-
- Sleek, glossy black design""",
|
| 50 |
-
"width": 1024,
|
| 51 |
-
"height": 1024
|
| 52 |
-
},
|
| 53 |
-
{
|
| 54 |
-
"title": "Futuristic Electric Bicycle",
|
| 55 |
-
"prompt": """An industrial design sketch of an electric bike:
|
| 56 |
-
- Lightweight carbon frame, aerodynamic lines
|
| 57 |
-
- Integrated battery, sleek display on handlebars
|
| 58 |
-
- Neon color highlights on wheels
|
| 59 |
-
- High-tech vibe, minimal clutter""",
|
| 60 |
-
"width": 1024,
|
| 61 |
-
"height": 1024
|
| 62 |
-
},
|
| 63 |
-
{
|
| 64 |
-
"title": "Concept Car Interior",
|
| 65 |
-
"prompt": """A luxurious and futuristic car interior concept:
|
| 66 |
-
- Wrap-around digital dashboard
|
| 67 |
-
- Minimalistic steering control, seat controls on touchscreen
|
| 68 |
-
- Ambient LED accent lights
|
| 69 |
-
- Soft leather seats, bright accent stitching""",
|
| 70 |
-
"width": 1024,
|
| 71 |
-
"height": 1024
|
| 72 |
-
}
|
| 73 |
-
]
|
| 74 |
-
|
| 75 |
-
# Convert examples to Gradio format (if needed)
|
| 76 |
-
GRADIO_EXAMPLES = [
|
| 77 |
-
[example["prompt"], example["width"], example["height"]]
|
| 78 |
-
for example in EXAMPLES
|
| 79 |
-
]
|
| 80 |
-
|
| 81 |
@spaces.GPU()
|
| 82 |
-
def
|
| 83 |
if randomize_seed:
|
| 84 |
seed = random.randint(0, MAX_SEED)
|
| 85 |
-
generator = torch.Generator().manual_seed(seed)
|
| 86 |
image = pipe(
|
| 87 |
prompt=prompt,
|
| 88 |
width=width,
|
| 89 |
height=height,
|
| 90 |
-
num_inference_steps=
|
| 91 |
generator=generator,
|
| 92 |
-
guidance_scale=
|
| 93 |
).images[0]
|
| 94 |
return image, seed
|
| 95 |
|
| 96 |
-
# CSS ์คํ์ผ (
|
| 97 |
css = """
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
flex: 1;
|
| 105 |
-
padding: 20px;
|
| 106 |
-
border-right: 2px solid #eee;
|
| 107 |
-
max-width: 800px;
|
| 108 |
}
|
| 109 |
-
.
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
text-align: center;
|
| 117 |
-
color: #2a2a2a;
|
| 118 |
-
padding: 20px;
|
| 119 |
-
font-size: 2.5em;
|
| 120 |
-
font-weight: bold;
|
| 121 |
-
background: linear-gradient(90deg, #f0f0f0 0%, #ffffff 100%);
|
| 122 |
-
border-bottom: 3px solid #ddd;
|
| 123 |
-
margin-bottom: 30px;
|
| 124 |
}
|
| 125 |
-
.
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
margin-bottom: 30px;
|
| 129 |
}
|
| 130 |
-
.
|
| 131 |
-
background:
|
| 132 |
-
padding: 20px;
|
| 133 |
border-radius: 10px;
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
width: 100%;
|
| 137 |
-
}
|
| 138 |
-
.input-box textarea {
|
| 139 |
-
width: 100% !important;
|
| 140 |
-
min-width: 600px !important;
|
| 141 |
-
font-size: 14px !important;
|
| 142 |
-
line-height: 1.5 !important;
|
| 143 |
-
padding: 12px !important;
|
| 144 |
-
}
|
| 145 |
-
.example-card {
|
| 146 |
-
background: white;
|
| 147 |
-
padding: 15px;
|
| 148 |
-
margin: 10px 0;
|
| 149 |
-
border-radius: 8px;
|
| 150 |
-
box-shadow: 0 2px 5px rgba(0,0,0,0.05);
|
| 151 |
}
|
| 152 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 153 |
font-weight: bold;
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
.
|
| 158 |
-
max-width: 1400px !important;
|
| 159 |
-
margin: 0 auto !important;
|
| 160 |
-
}
|
| 161 |
-
.input-area {
|
| 162 |
-
flex: 2 !important;
|
| 163 |
}
|
| 164 |
-
.
|
| 165 |
-
|
| 166 |
}
|
| 167 |
"""
|
| 168 |
|
| 169 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 170 |
gr.Markdown(
|
| 171 |
"""
|
| 172 |
-
<div
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
)
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
|
|
|
|
|
|
|
|
|
| 198 |
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
height = gr.Slider(
|
| 208 |
-
label="Height",
|
| 209 |
-
minimum=256,
|
| 210 |
-
maximum=MAX_IMAGE_SIZE,
|
| 211 |
-
step=32,
|
| 212 |
-
value=1024,
|
| 213 |
-
)
|
| 214 |
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 222 |
|
| 223 |
-
#
|
| 224 |
-
with gr.
|
| 225 |
-
gr.Markdown("###
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 251 |
)
|
| 252 |
|
| 253 |
if __name__ == "__main__":
|
|
|
|
| 9 |
dtype = torch.bfloat16
|
| 10 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 11 |
|
| 12 |
+
# ๋ชจ๋ธ ๋ก๋ (FLUX.1-schnell)
|
| 13 |
pipe = DiffusionPipeline.from_pretrained(
|
| 14 |
"black-forest-labs/FLUX.1-schnell",
|
| 15 |
torch_dtype=dtype
|
|
|
|
| 18 |
MAX_SEED = np.iinfo(np.int32).max
|
| 19 |
MAX_IMAGE_SIZE = 2048
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
@spaces.GPU()
|
| 22 |
+
def generate_image(prompt, seed, randomize_seed, width, height, steps, guidance_scale):
|
| 23 |
if randomize_seed:
|
| 24 |
seed = random.randint(0, MAX_SEED)
|
| 25 |
+
generator = torch.Generator(device).manual_seed(seed)
|
| 26 |
image = pipe(
|
| 27 |
prompt=prompt,
|
| 28 |
width=width,
|
| 29 |
height=height,
|
| 30 |
+
num_inference_steps=steps,
|
| 31 |
generator=generator,
|
| 32 |
+
guidance_scale=guidance_scale
|
| 33 |
).images[0]
|
| 34 |
return image, seed
|
| 35 |
|
| 36 |
+
# CSS ์คํ์ผ (์ข์ธก ์ฌ์ด๋๋ฐ ๋ฐ ์ ์ฒด ๋ ์ด์์ ์ฐธ๊ณ )
|
| 37 |
css = """
|
| 38 |
+
body {
|
| 39 |
+
background: linear-gradient(135deg, #667eea, #764ba2);
|
| 40 |
+
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
| 41 |
+
color: #333;
|
| 42 |
+
margin: 0;
|
| 43 |
+
padding: 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
}
|
| 45 |
+
.gradio-container {
|
| 46 |
+
background: rgba(255, 255, 255, 0.95);
|
| 47 |
+
border-radius: 15px;
|
| 48 |
+
padding: 30px 40px;
|
| 49 |
+
box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
|
| 50 |
+
margin: 40px auto;
|
| 51 |
+
max-width: 1200px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
}
|
| 53 |
+
.gradio-container h1 {
|
| 54 |
+
color: #333;
|
| 55 |
+
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
|
|
|
|
| 56 |
}
|
| 57 |
+
.sidebar {
|
| 58 |
+
background: rgba(255, 255, 255, 0.98);
|
|
|
|
| 59 |
border-radius: 10px;
|
| 60 |
+
padding: 20px;
|
| 61 |
+
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
}
|
| 63 |
+
button, .btn {
|
| 64 |
+
background: linear-gradient(90deg, #ff8a00, #e52e71);
|
| 65 |
+
border: none;
|
| 66 |
+
color: #fff;
|
| 67 |
+
padding: 12px 24px;
|
| 68 |
+
text-transform: uppercase;
|
| 69 |
font-weight: bold;
|
| 70 |
+
letter-spacing: 1px;
|
| 71 |
+
border-radius: 5px;
|
| 72 |
+
cursor: pointer;
|
| 73 |
+
transition: transform 0.2s ease-in-out;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
}
|
| 75 |
+
button:hover, .btn:hover {
|
| 76 |
+
transform: scale(1.05);
|
| 77 |
}
|
| 78 |
"""
|
| 79 |
|
| 80 |
+
# ์์ ํ๋กฌํํธ (๊ฐ ํญ๋ณ๋ก ๋ค์ํ ์์)
|
| 81 |
+
example_prompts = {
|
| 82 |
+
"Flowchart": [
|
| 83 |
+
"A hand-drawn style flowchart depicting a software release pipeline with clear nodes for development, testing, deployment, and maintenance.",
|
| 84 |
+
"An illustrated business process flowchart for a customer service workflow, with decision points and clear labels.",
|
| 85 |
+
"A creative flowchart showing the steps of a marketing campaign from ideation to execution."
|
| 86 |
+
],
|
| 87 |
+
"Infographic": [
|
| 88 |
+
"A visually appealing infographic displaying global sales data with vibrant colors, icons, and modern design elements.",
|
| 89 |
+
"An infographic illustrating startup growth metrics with graphs, charts, and minimalist design.",
|
| 90 |
+
"A data-driven infographic showcasing key performance indicators for a corporate strategy, with clear sections and illustrations."
|
| 91 |
+
],
|
| 92 |
+
"Mockup": [
|
| 93 |
+
"A sketch-style UX mockup for a mobile banking app login flow, featuring clean lines and minimalist design.",
|
| 94 |
+
"A wireframe mockup for an e-commerce website homepage, with user-friendly navigation and modern layout.",
|
| 95 |
+
"A prototype mockup for a productivity dashboard with a focus on intuitive user interface elements."
|
| 96 |
+
],
|
| 97 |
+
"Diagram": [
|
| 98 |
+
"An educational diagram of a supply chain process, with clear labels and vibrant, friendly illustrations.",
|
| 99 |
+
"A business diagram showing the flow of information between departments in an organization, with modern icons and a clean layout.",
|
| 100 |
+
"A conceptual diagram of a data pipeline, illustrating each step with simple, engaging visuals."
|
| 101 |
+
],
|
| 102 |
+
"Design": [
|
| 103 |
+
"A sleek industrial design concept for a modern office chair, featuring ergonomic curves and minimalist aesthetics.",
|
| 104 |
+
"A futuristic design for a high-tech smart conference room, blending modern materials with interactive displays.",
|
| 105 |
+
"A creative product design for a smart coffee machine with a metallic finish and touch interface."
|
| 106 |
+
]
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
# ๊ฐ๋จํ ์์ ํธ๋ค๋ฌ (์์ ๋ฒํผ ํด๋ฆญ ์ ํ๋กฌํํธ ์
๋ฐ์ดํธ)
|
| 110 |
+
def set_prompt(example_text):
|
| 111 |
+
return example_text
|
| 112 |
+
|
| 113 |
+
with gr.Blocks(css=css, title="๋น์ฆ๋์ค ์์ด์ ํธ ์ด๋ฏธ์ง ์์ฑ๊ธฐ") as demo:
|
| 114 |
gr.Markdown(
|
| 115 |
"""
|
| 116 |
+
<div style="text-align:center;">
|
| 117 |
+
<h1>๋น์ฆ๋์ค ์์ด์ ํธ ์ด๋ฏธ์ง ์์ฑ๊ธฐ</h1>
|
| 118 |
+
<p>๋น์ฆ๋์ค์ ํ์ํ ๋ค์ํ ์์๋ฅผ ํญ๋ณ๋ก ๊ตฌ๋ถํ์ฌ ํ๋ก์ธ์ค๋ณ ์์ฌ๊ฒฐ์ ๋ฐ ๋์์ธ์ ์์ฑํฉ๋๋ค.</p>
|
| 119 |
+
<p><strong>Gini's AI Spaces:</strong> Flowchart, Infographic, Mockup, Diagram, Design</p>
|
| 120 |
+
</div>
|
| 121 |
+
"""
|
| 122 |
+
)
|
| 123 |
+
|
| 124 |
+
with gr.Row():
|
| 125 |
+
# ๋ฉ์ธ ์์ญ: ํญ๋ณ๋ก ๋ถ๋ฆฌ๋ ์์ฑ ์ธํฐํ์ด์ค
|
| 126 |
+
with gr.Column(scale=8):
|
| 127 |
+
with gr.Tabs():
|
| 128 |
+
## Flowchart ํญ
|
| 129 |
+
with gr.Tab("Flowchart"):
|
| 130 |
+
flow_prompt = gr.Textbox(label="Flowchart Prompt", placeholder="Enter a flowchart description...", lines=5)
|
| 131 |
+
flow_generate = gr.Button("Generate Flowchart")
|
| 132 |
+
flow_image = gr.Image(label="Generated Flowchart")
|
| 133 |
+
with gr.Accordion("Example Prompts", open=False):
|
| 134 |
+
for ex in example_prompts["Flowchart"]:
|
| 135 |
+
gr.Button(ex, variant="secondary").click(fn=lambda ex=ex: set_prompt(ex), outputs=flow_prompt)
|
| 136 |
+
|
| 137 |
+
## Infographic ํญ
|
| 138 |
+
with gr.Tab("Infographic"):
|
| 139 |
+
info_prompt = gr.Textbox(label="Infographic Prompt", placeholder="Enter an infographic description...", lines=5)
|
| 140 |
+
info_generate = gr.Button("Generate Infographic")
|
| 141 |
+
info_image = gr.Image(label="Generated Infographic")
|
| 142 |
+
with gr.Accordion("Example Prompts", open=False):
|
| 143 |
+
for ex in example_prompts["Infographic"]:
|
| 144 |
+
gr.Button(ex, variant="secondary").click(fn=lambda ex=ex: set_prompt(ex), outputs=info_prompt)
|
| 145 |
|
| 146 |
+
## Mockup ํญ
|
| 147 |
+
with gr.Tab("Mockup"):
|
| 148 |
+
mock_prompt = gr.Textbox(label="Mockup Prompt", placeholder="Enter a mockup description...", lines=5)
|
| 149 |
+
mock_generate = gr.Button("Generate Mockup")
|
| 150 |
+
mock_image = gr.Image(label="Generated Mockup")
|
| 151 |
+
with gr.Accordion("Example Prompts", open=False):
|
| 152 |
+
for ex in example_prompts["Mockup"]:
|
| 153 |
+
gr.Button(ex, variant="secondary").click(fn=lambda ex=ex: set_prompt(ex), outputs=mock_prompt)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 154 |
|
| 155 |
+
## Diagram ํญ
|
| 156 |
+
with gr.Tab("Diagram"):
|
| 157 |
+
diag_prompt = gr.Textbox(label="Diagram Prompt", placeholder="Enter a diagram description...", lines=5)
|
| 158 |
+
diag_generate = gr.Button("Generate Diagram")
|
| 159 |
+
diag_image = gr.Image(label="Generated Diagram")
|
| 160 |
+
with gr.Accordion("Example Prompts", open=False):
|
| 161 |
+
for ex in example_prompts["Diagram"]:
|
| 162 |
+
gr.Button(ex, variant="secondary").click(fn=lambda ex=ex: set_prompt(ex), outputs=diag_prompt)
|
| 163 |
+
|
| 164 |
+
## Design ํญ
|
| 165 |
+
with gr.Tab("Design"):
|
| 166 |
+
des_prompt = gr.Textbox(label="Design Prompt", placeholder="Enter a design concept...", lines=5)
|
| 167 |
+
des_generate = gr.Button("Generate Design")
|
| 168 |
+
des_image = gr.Image(label="Generated Design")
|
| 169 |
+
with gr.Accordion("Example Prompts", open=False):
|
| 170 |
+
for ex in example_prompts["Design"]:
|
| 171 |
+
gr.Button(ex, variant="secondary").click(fn=lambda ex=ex: set_prompt(ex), outputs=des_prompt)
|
| 172 |
|
| 173 |
+
# ์ข์ธก ์ฌ์ด๋๋ฐ: ๊ณตํต ์์ฑ ํ๋ผ๋ฏธํฐ
|
| 174 |
+
with gr.Sidebar(label="Parameters", open=True):
|
| 175 |
+
gr.Markdown("### Generation Parameters")
|
| 176 |
+
seed_slider = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=42)
|
| 177 |
+
randomize_seed = gr.Checkbox(label="Randomize Seed", value=True)
|
| 178 |
+
width_slider = gr.Slider(label="Width", minimum=256, maximum=MAX_IMAGE_SIZE, step=32, value=1024)
|
| 179 |
+
height_slider = gr.Slider(label="Height", minimum=256, maximum=MAX_IMAGE_SIZE, step=32, value=1024)
|
| 180 |
+
steps_slider = gr.Slider(label="Inference Steps", minimum=1, maximum=50, step=1, value=20)
|
| 181 |
+
guidance_slider = gr.Slider(label="Guidance Scale", minimum=0.0, maximum=15.0, step=0.5, value=7.5)
|
| 182 |
+
|
| 183 |
+
# ๊ฐ ํญ๋ณ ์์ฑ ๋ฒํผ์ ์ด๋ฒคํธ ์ฐ๊ฒฐ
|
| 184 |
+
flow_generate.click(
|
| 185 |
+
fn=generate_image,
|
| 186 |
+
inputs=[flow_prompt, seed_slider, randomize_seed, width_slider, height_slider, steps_slider, guidance_slider],
|
| 187 |
+
outputs=[flow_image, seed_slider]
|
| 188 |
+
)
|
| 189 |
+
|
| 190 |
+
info_generate.click(
|
| 191 |
+
fn=generate_image,
|
| 192 |
+
inputs=[info_prompt, seed_slider, randomize_seed, width_slider, height_slider, steps_slider, guidance_slider],
|
| 193 |
+
outputs=[info_image, seed_slider]
|
| 194 |
+
)
|
| 195 |
+
|
| 196 |
+
mock_generate.click(
|
| 197 |
+
fn=generate_image,
|
| 198 |
+
inputs=[mock_prompt, seed_slider, randomize_seed, width_slider, height_slider, steps_slider, guidance_slider],
|
| 199 |
+
outputs=[mock_image, seed_slider]
|
| 200 |
+
)
|
| 201 |
+
|
| 202 |
+
diag_generate.click(
|
| 203 |
+
fn=generate_image,
|
| 204 |
+
inputs=[diag_prompt, seed_slider, randomize_seed, width_slider, height_slider, steps_slider, guidance_slider],
|
| 205 |
+
outputs=[diag_image, seed_slider]
|
| 206 |
+
)
|
| 207 |
+
|
| 208 |
+
des_generate.click(
|
| 209 |
+
fn=generate_image,
|
| 210 |
+
inputs=[des_prompt, seed_slider, randomize_seed, width_slider, height_slider, steps_slider, guidance_slider],
|
| 211 |
+
outputs=[des_image, seed_slider]
|
| 212 |
)
|
| 213 |
|
| 214 |
if __name__ == "__main__":
|