Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -89,7 +89,7 @@ def generate(
|
|
89 |
use_prompt_2: bool = False,
|
90 |
use_negative_prompt_2: bool = False,
|
91 |
seed: int = 0,
|
92 |
-
width: int =
|
93 |
height: int = 1024,
|
94 |
guidance_scale_base: float = 5.0,
|
95 |
guidance_scale_refiner: float = 5.0,
|
@@ -159,13 +159,13 @@ with gr.Blocks(css="style.css") as demo:
|
|
159 |
)
|
160 |
with gr.Group():
|
161 |
with gr.Row():
|
162 |
-
prompt = gr.Text(
|
163 |
label="提示词",
|
164 |
show_label=False,
|
165 |
max_lines=1,
|
166 |
placeholder="输入要生成的画面内容",
|
167 |
container=False,
|
168 |
-
)
|
169 |
run_button = gr.Button("生成", scale=0)
|
170 |
result = gr.Image(label="生成结果", show_label=False)
|
171 |
with gr.Accordion("高级选项", open=False):
|
@@ -173,24 +173,24 @@ with gr.Blocks(css="style.css") as demo:
|
|
173 |
use_negative_prompt = gr.Checkbox(label="使用反向提示词", value=False)
|
174 |
use_prompt_2 = gr.Checkbox(label="使用提示词 2", value=False)
|
175 |
use_negative_prompt_2 = gr.Checkbox(label="使用反向提示词 2", value=False)
|
176 |
-
negative_prompt = gr.Text(
|
177 |
label="反向提示词",
|
178 |
max_lines=1,
|
179 |
placeholder="输入不想在画面中出现的内容,比如:“胡子”,“人群”",
|
180 |
visible=False,
|
181 |
-
)
|
182 |
-
prompt_2 = gr.Text(
|
183 |
label="提示词 2",
|
184 |
max_lines=1,
|
185 |
placeholder="输入你的提示词",
|
186 |
visible=False,
|
187 |
-
)
|
188 |
-
negative_prompt_2 = gr.Text(
|
189 |
label="反向提示词 2",
|
190 |
max_lines=1,
|
191 |
placeholder="输入你的反向提示词",
|
192 |
visible=False,
|
193 |
-
)
|
194 |
|
195 |
seed = gr.Slider(
|
196 |
label="种子数",
|
@@ -300,10 +300,10 @@ with gr.Blocks(css="style.css") as demo:
|
|
300 |
).then(
|
301 |
fn=generate,
|
302 |
inputs=[
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
use_negative_prompt,
|
308 |
use_prompt_2,
|
309 |
use_negative_prompt_2,
|
|
|
89 |
use_prompt_2: bool = False,
|
90 |
use_negative_prompt_2: bool = False,
|
91 |
seed: int = 0,
|
92 |
+
width: int = 736,
|
93 |
height: int = 1024,
|
94 |
guidance_scale_base: float = 5.0,
|
95 |
guidance_scale_refiner: float = 5.0,
|
|
|
159 |
)
|
160 |
with gr.Group():
|
161 |
with gr.Row():
|
162 |
+
prompt = process_text(gr.Text(
|
163 |
label="提示词",
|
164 |
show_label=False,
|
165 |
max_lines=1,
|
166 |
placeholder="输入要生成的画面内容",
|
167 |
container=False,
|
168 |
+
))
|
169 |
run_button = gr.Button("生成", scale=0)
|
170 |
result = gr.Image(label="生成结果", show_label=False)
|
171 |
with gr.Accordion("高级选项", open=False):
|
|
|
173 |
use_negative_prompt = gr.Checkbox(label="使用反向提示词", value=False)
|
174 |
use_prompt_2 = gr.Checkbox(label="使用提示词 2", value=False)
|
175 |
use_negative_prompt_2 = gr.Checkbox(label="使用反向提示词 2", value=False)
|
176 |
+
negative_prompt = process_text(gr.Text(
|
177 |
label="反向提示词",
|
178 |
max_lines=1,
|
179 |
placeholder="输入不想在画面中出现的内容,比如:“胡子”,“人群”",
|
180 |
visible=False,
|
181 |
+
))
|
182 |
+
prompt_2 = process_text(gr.Text(
|
183 |
label="提示词 2",
|
184 |
max_lines=1,
|
185 |
placeholder="输入你的提示词",
|
186 |
visible=False,
|
187 |
+
))
|
188 |
+
negative_prompt_2 = process_text(gr.Text(
|
189 |
label="反向提示词 2",
|
190 |
max_lines=1,
|
191 |
placeholder="输入你的反向提示词",
|
192 |
visible=False,
|
193 |
+
))
|
194 |
|
195 |
seed = gr.Slider(
|
196 |
label="种子数",
|
|
|
300 |
).then(
|
301 |
fn=generate,
|
302 |
inputs=[
|
303 |
+
prompt,
|
304 |
+
negative_prompt,
|
305 |
+
prompt_2,
|
306 |
+
negative_prompt_2,
|
307 |
use_negative_prompt,
|
308 |
use_prompt_2,
|
309 |
use_negative_prompt_2,
|