Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ STYLE_PRESETS = [None, "3d-model", "analog-film", "anime", "cinematic", "comic-b
|
|
10 |
MAX_SEED = np.iinfo(np.int32).max
|
11 |
|
12 |
|
13 |
-
def generate_image(upload_images, prompt, negative_prompt, style_preset, steps, strength, seed, progress=gr.Progress(track_tqdm=True)):
|
14 |
error_if_no_img(prompt)
|
15 |
|
16 |
job = prodia.create("/photomaker",
|
@@ -19,6 +19,7 @@ def generate_image(upload_images, prompt, negative_prompt, style_preset, steps,
|
|
19 |
negative_prompt=negative_prompt,
|
20 |
style_preset=style_preset,
|
21 |
steps=steps,
|
|
|
22 |
strength=strength,
|
23 |
seed=seed if seed != 0 else None
|
24 |
)
|
@@ -107,27 +108,35 @@ with gr.Blocks(css=css) as demo:
|
|
107 |
placeholder="low quality",
|
108 |
value="nsfw, lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry",
|
109 |
)
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
with gr.Column():
|
132 |
result_image = gr.Image(label="Generated Image")
|
133 |
|
@@ -136,7 +145,7 @@ with gr.Blocks(css=css) as demo:
|
|
136 |
|
137 |
submit.click(
|
138 |
fn=generate_image,
|
139 |
-
inputs=[files, prompt, negative_prompt, style, steps, strength_ratio, seed],
|
140 |
outputs=[result_image]
|
141 |
)
|
142 |
|
|
|
10 |
MAX_SEED = np.iinfo(np.int32).max
|
11 |
|
12 |
|
13 |
+
def generate_image(upload_images, prompt, negative_prompt, style_preset, steps, cfg_scale, strength, seed, progress=gr.Progress(track_tqdm=True)):
|
14 |
error_if_no_img(prompt)
|
15 |
|
16 |
job = prodia.create("/photomaker",
|
|
|
19 |
negative_prompt=negative_prompt,
|
20 |
style_preset=style_preset,
|
21 |
steps=steps,
|
22 |
+
cfg_scale,
|
23 |
strength=strength,
|
24 |
seed=seed if seed != 0 else None
|
25 |
)
|
|
|
108 |
placeholder="low quality",
|
109 |
value="nsfw, lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry",
|
110 |
)
|
111 |
+
with gr.Row():
|
112 |
+
steps = gr.Slider(
|
113 |
+
label="Number of sample steps",
|
114 |
+
minimum=20,
|
115 |
+
maximum=50,
|
116 |
+
step=1,
|
117 |
+
value=40,
|
118 |
+
)
|
119 |
+
cfg_scale = gr.Slider(
|
120 |
+
label="CFG Scale",
|
121 |
+
minimum=5,
|
122 |
+
maximum=20,
|
123 |
+
value=7,
|
124 |
+
)
|
125 |
+
with gr.Row():
|
126 |
+
strength_ratio = gr.Slider(
|
127 |
+
label="Strength (%)",
|
128 |
+
minimum=15,
|
129 |
+
maximum=50,
|
130 |
+
step=1,
|
131 |
+
value=20,
|
132 |
+
)
|
133 |
+
seed = gr.Slider(
|
134 |
+
label="Seed",
|
135 |
+
minimum=0,
|
136 |
+
maximum=MAX_SEED,
|
137 |
+
step=1,
|
138 |
+
value=0,
|
139 |
+
)
|
140 |
with gr.Column():
|
141 |
result_image = gr.Image(label="Generated Image")
|
142 |
|
|
|
145 |
|
146 |
submit.click(
|
147 |
fn=generate_image,
|
148 |
+
inputs=[files, prompt, negative_prompt, style, steps, cfg_scale, strength_ratio, seed],
|
149 |
outputs=[result_image]
|
150 |
)
|
151 |
|