Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -96,48 +96,48 @@ footer {
|
|
96 |
}
|
97 |
'''
|
98 |
with gr.Blocks(css=css) as demo:
|
99 |
-
gr.Markdown("""#
|
100 |
-
###
|
101 |
with gr.Group():
|
102 |
with gr.Row():
|
103 |
prompt = gr.Text(
|
104 |
-
label="
|
105 |
show_label=False,
|
106 |
max_lines=1,
|
107 |
-
placeholder="
|
108 |
container=False,
|
109 |
)
|
110 |
-
run_button = gr.Button("
|
111 |
-
result = gr.Gallery(label="
|
112 |
-
with gr.Accordion("
|
113 |
with gr.Row():
|
114 |
-
use_negative_prompt = gr.Checkbox(label="
|
115 |
negative_prompt = gr.Text(
|
116 |
-
label="
|
117 |
max_lines=5,
|
118 |
lines=4,
|
119 |
-
placeholder="
|
120 |
value="lowres, {bad}, error, fewer, extra, missing, worst quality, jpeg artifacts, bad quality, watermark, unfinished, displeasing, chromatic aberration, signature, extra digits, artistic error, username, scan, [abstract]",
|
121 |
visible=True,
|
122 |
)
|
123 |
seed = gr.Slider(
|
124 |
-
label="
|
125 |
minimum=0,
|
126 |
maximum=MAX_SEED,
|
127 |
step=1,
|
128 |
value=0,
|
129 |
)
|
130 |
-
randomize_seed = gr.Checkbox(label="
|
131 |
with gr.Row(visible=True):
|
132 |
width = gr.Slider(
|
133 |
-
label="
|
134 |
minimum=512,
|
135 |
maximum=MAX_IMAGE_SIZE,
|
136 |
step=64,
|
137 |
value=1024,
|
138 |
)
|
139 |
height = gr.Slider(
|
140 |
-
label="
|
141 |
minimum=512,
|
142 |
maximum=MAX_IMAGE_SIZE,
|
143 |
step=64,
|
@@ -152,7 +152,7 @@ with gr.Blocks(css=css) as demo:
|
|
152 |
value=3.0,
|
153 |
)
|
154 |
num_inference_steps = gr.Slider(
|
155 |
-
label="
|
156 |
minimum=1,
|
157 |
maximum=50,
|
158 |
step=1,
|
@@ -171,7 +171,6 @@ with gr.Blocks(css=css) as demo:
|
|
171 |
fn=lambda x: gr.update(visible=x),
|
172 |
inputs=use_negative_prompt,
|
173 |
outputs=negative_prompt,
|
174 |
-
api_name=False,
|
175 |
)
|
176 |
|
177 |
gr.on(
|
@@ -193,8 +192,7 @@ with gr.Blocks(css=css) as demo:
|
|
193 |
randomize_seed,
|
194 |
],
|
195 |
outputs=[result, seed],
|
196 |
-
api_name="run",
|
197 |
)
|
198 |
|
199 |
if __name__ == "__main__":
|
200 |
-
demo.queue(max_size=
|
|
|
96 |
}
|
97 |
'''
|
98 |
with gr.Blocks(css=css) as demo:
|
99 |
+
gr.Markdown("""# 梦羽的模型生成器
|
100 |
+
### 快速生成NoobXL的模型图片.""")
|
101 |
with gr.Group():
|
102 |
with gr.Row():
|
103 |
prompt = gr.Text(
|
104 |
+
label="关键词",
|
105 |
show_label=False,
|
106 |
max_lines=1,
|
107 |
+
placeholder="输入你要的图片关键词",
|
108 |
container=False,
|
109 |
)
|
110 |
+
run_button = gr.Button("生成", scale=0)
|
111 |
+
result = gr.Gallery(label="返回", columns=1)
|
112 |
+
with gr.Accordion("高级选项", open=False):
|
113 |
with gr.Row():
|
114 |
+
use_negative_prompt = gr.Checkbox(label="使用反向词条", value=True)
|
115 |
negative_prompt = gr.Text(
|
116 |
+
label="反向词条",
|
117 |
max_lines=5,
|
118 |
lines=4,
|
119 |
+
placeholder="输入你要排除的图片关键词",
|
120 |
value="lowres, {bad}, error, fewer, extra, missing, worst quality, jpeg artifacts, bad quality, watermark, unfinished, displeasing, chromatic aberration, signature, extra digits, artistic error, username, scan, [abstract]",
|
121 |
visible=True,
|
122 |
)
|
123 |
seed = gr.Slider(
|
124 |
+
label="种子",
|
125 |
minimum=0,
|
126 |
maximum=MAX_SEED,
|
127 |
step=1,
|
128 |
value=0,
|
129 |
)
|
130 |
+
randomize_seed = gr.Checkbox(label="随机种子", value=True)
|
131 |
with gr.Row(visible=True):
|
132 |
width = gr.Slider(
|
133 |
+
label="宽度",
|
134 |
minimum=512,
|
135 |
maximum=MAX_IMAGE_SIZE,
|
136 |
step=64,
|
137 |
value=1024,
|
138 |
)
|
139 |
height = gr.Slider(
|
140 |
+
label="高度",
|
141 |
minimum=512,
|
142 |
maximum=MAX_IMAGE_SIZE,
|
143 |
step=64,
|
|
|
152 |
value=3.0,
|
153 |
)
|
154 |
num_inference_steps = gr.Slider(
|
155 |
+
label="生成步数",
|
156 |
minimum=1,
|
157 |
maximum=50,
|
158 |
step=1,
|
|
|
171 |
fn=lambda x: gr.update(visible=x),
|
172 |
inputs=use_negative_prompt,
|
173 |
outputs=negative_prompt,
|
|
|
174 |
)
|
175 |
|
176 |
gr.on(
|
|
|
192 |
randomize_seed,
|
193 |
],
|
194 |
outputs=[result, seed],
|
|
|
195 |
)
|
196 |
|
197 |
if __name__ == "__main__":
|
198 |
+
demo.queue(max_size=20).launch()
|