Spaces:
Build error
Build error
Commit
·
bdcf68c
1
Parent(s):
49ca7dc
Update app.py
Browse files
app.py
CHANGED
@@ -183,8 +183,6 @@ def txt_to_img(model_path, prompt, n_images, neg_prompt, guidance, steps, width,
|
|
183 |
callback=pipe_callback)
|
184 |
|
185 |
# update_state(f"Done. Seed: {seed}")
|
186 |
-
|
187 |
-
return replace_nsfw_images(result)
|
188 |
|
189 |
def img_to_img(model_path, prompt, n_images, neg_prompt, img, strength, guidance, steps, width, height, generator, seed):
|
190 |
|
@@ -237,17 +235,6 @@ def img_to_img(model_path, prompt, n_images, neg_prompt, img, strength, guidance
|
|
237 |
|
238 |
# update_state(f"Done. Seed: {seed}")
|
239 |
|
240 |
-
return replace_nsfw_images(result)
|
241 |
-
|
242 |
-
def replace_nsfw_images(results):
|
243 |
-
|
244 |
-
if is_colab:
|
245 |
-
return results.images
|
246 |
-
|
247 |
-
for i in range(len(results.images)):
|
248 |
-
if results.nsfw_content_detected[i]:
|
249 |
-
results.images[i] = Image.open("nsfw.png")
|
250 |
-
return results.images
|
251 |
|
252 |
# css = """.finetuned-diffusion-div div{display:inline-flex;align-items:center;gap:.8rem;font-size:1.75rem}.finetuned-diffusion-div div h1{font-weight:900;margin-bottom:7px}.finetuned-diffusion-div p{margin-bottom:10px;font-size:94%}a{text-decoration:underline}.tabs{margin-top:0;margin-bottom:0}#gallery{min-height:20rem}
|
253 |
# """
|
@@ -332,16 +319,7 @@ with gr.Blocks(css="style.css") as demo:
|
|
332 |
], inputs=[model_name, prompt, guidance, steps], outputs=outputs, fn=inference, cache_examples=False)
|
333 |
|
334 |
gr.HTML("""
|
335 |
-
|
336 |
-
<br>
|
337 |
-
<p>Models by <a href="https://huggingface.co/nitrosocke">@nitrosocke</a>, <a href="https://twitter.com/haruu1367">@haruu1367</a>, <a href="https://twitter.com/DGSpitzer">@Helixngc7293</a>, <a href="https://twitter.com/dal_mack">@dal_mack</a>, <a href="https://twitter.com/prompthero">@prompthero</a> and others. ❤️</p>
|
338 |
-
<p>This space uses the <a href="https://github.com/LuChengTHU/dpm-solver">DPM-Solver++</a> sampler by <a href="https://arxiv.org/abs/2206.00927">Cheng Lu, et al.</a>.</p>
|
339 |
-
<p>Space by:<br>
|
340 |
-
<a href="https://twitter.com/hahahahohohe"><img src="https://img.shields.io/twitter/follow/hahahahohohe?label=%40anzorq&style=social" alt="Twitter Follow"></a><br>
|
341 |
-
<a href="https://github.com/qunash"><img alt="GitHub followers" src="https://img.shields.io/github/followers/qunash?style=social" alt="Github Follow"></a></p><br><br>
|
342 |
-
<a href="https://www.buymeacoffee.com/anzorq" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 45px !important;width: 162px !important;" ></a><br><br>
|
343 |
-
<p><img src="https://visitor-badge.glitch.me/badge?page_id=anzorq.finetuned_diffusion" alt="visitors"></p>
|
344 |
-
</div>
|
345 |
""")
|
346 |
|
347 |
demo.load(update_state_info, inputs=state_info, outputs=state_info, every=0.5, show_progress=False)
|
|
|
183 |
callback=pipe_callback)
|
184 |
|
185 |
# update_state(f"Done. Seed: {seed}")
|
|
|
|
|
186 |
|
187 |
def img_to_img(model_path, prompt, n_images, neg_prompt, img, strength, guidance, steps, width, height, generator, seed):
|
188 |
|
|
|
235 |
|
236 |
# update_state(f"Done. Seed: {seed}")
|
237 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
238 |
|
239 |
# css = """.finetuned-diffusion-div div{display:inline-flex;align-items:center;gap:.8rem;font-size:1.75rem}.finetuned-diffusion-div div h1{font-weight:900;margin-bottom:7px}.finetuned-diffusion-div p{margin-bottom:10px;font-size:94%}a{text-decoration:underline}.tabs{margin-top:0;margin-bottom:0}#gallery{min-height:20rem}
|
240 |
# """
|
|
|
319 |
], inputs=[model_name, prompt, guidance, steps], outputs=outputs, fn=inference, cache_examples=False)
|
320 |
|
321 |
gr.HTML("""
|
322 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
323 |
""")
|
324 |
|
325 |
demo.load(update_state_info, inputs=state_info, outputs=state_info, every=0.5, show_progress=False)
|