Spaces:
Runtime error
Runtime error
Commit ·
9586f99
1
Parent(s): c242249
edited models array and remove second tab
Browse files
app.py
CHANGED
|
@@ -38,44 +38,45 @@ class RenderNet:
|
|
| 38 |
return job_result
|
| 39 |
|
| 40 |
def list_models(self):
|
| 41 |
-
response =
|
| 42 |
-
'
|
| 43 |
-
'
|
| 44 |
-
'
|
| 45 |
-
'
|
| 46 |
-
'
|
| 47 |
-
'
|
| 48 |
-
'
|
| 49 |
-
'
|
| 50 |
-
'
|
| 51 |
-
'
|
| 52 |
-
'
|
| 53 |
-
'
|
| 54 |
-
'
|
| 55 |
-
'
|
| 56 |
-
'
|
| 57 |
-
'
|
| 58 |
-
'
|
| 59 |
-
'
|
| 60 |
-
'
|
| 61 |
-
'
|
| 62 |
-
'
|
| 63 |
-
'
|
| 64 |
-
'
|
| 65 |
-
'
|
| 66 |
-
'
|
| 67 |
-
'
|
| 68 |
-
'
|
| 69 |
-
'
|
| 70 |
-
'
|
| 71 |
-
'
|
| 72 |
-
'
|
| 73 |
-
'
|
| 74 |
-
'
|
| 75 |
-
'
|
| 76 |
-
'
|
| 77 |
-
'
|
| 78 |
-
'
|
|
|
|
| 79 |
]
|
| 80 |
|
| 81 |
return response
|
|
@@ -279,41 +280,5 @@ with gr.Blocks(css=css) as demo:
|
|
| 279 |
|
| 280 |
text_button.click(txt2img, inputs=[prompt, negative_prompt, model, steps, sampler, cfg_scale, width, height, seed], outputs=image_output)
|
| 281 |
|
| 282 |
-
with gr.Tab("PNG Info"):
|
| 283 |
-
def plaintext_to_html(text, classname=None):
|
| 284 |
-
content = "<br>\n".join(html.escape(x) for x in text.split('\n'))
|
| 285 |
-
|
| 286 |
-
return f"<p class='{classname}'>{content}</p>" if classname else f"<p>{content}</p>"
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
def get_exif_data(image):
|
| 290 |
-
items = image.info
|
| 291 |
-
|
| 292 |
-
info = ''
|
| 293 |
-
for key, text in items.items():
|
| 294 |
-
info += f"""
|
| 295 |
-
<div>
|
| 296 |
-
<p><b>{plaintext_to_html(str(key))}</b></p>
|
| 297 |
-
<p>{plaintext_to_html(str(text))}</p>
|
| 298 |
-
</div>
|
| 299 |
-
""".strip()+"\n"
|
| 300 |
-
|
| 301 |
-
if len(info) == 0:
|
| 302 |
-
message = "Nothing found in the image."
|
| 303 |
-
info = f"<div><p>{message}<p></div>"
|
| 304 |
-
|
| 305 |
-
return info
|
| 306 |
-
|
| 307 |
-
with gr.Row():
|
| 308 |
-
with gr.Column():
|
| 309 |
-
image_input = gr.Image(type="pil")
|
| 310 |
-
|
| 311 |
-
with gr.Column():
|
| 312 |
-
exif_output = gr.HTML(label="EXIF Data")
|
| 313 |
-
send_to_txt2img_btn = gr.Button("Send to txt2img")
|
| 314 |
-
|
| 315 |
-
image_input.upload(get_exif_data, inputs=[image_input], outputs=exif_output)
|
| 316 |
-
send_to_txt2img_btn.click(send_to_txt2img, inputs=[image_input], outputs=[tabs, prompt, negative_prompt, steps, seed,
|
| 317 |
-
model, sampler, width, height, cfg_scale], concurrency_limit=10)
|
| 318 |
|
| 319 |
demo.queue(max_size=80, api_open=False).launch(max_threads=256)
|
|
|
|
| 38 |
return job_result
|
| 39 |
|
| 40 |
def list_models(self):
|
| 41 |
+
response =[
|
| 42 |
+
'dreamshaper',
|
| 43 |
+
'ghost_mix',
|
| 44 |
+
'proto_vision',
|
| 45 |
+
'meina_unreal',
|
| 46 |
+
'realistic_vision',
|
| 47 |
+
'animerge',
|
| 48 |
+
'oil_painting',
|
| 49 |
+
'absolute_reality',
|
| 50 |
+
'meinamix',
|
| 51 |
+
'rpg',
|
| 52 |
+
'western_animation',
|
| 53 |
+
'dynavision',
|
| 54 |
+
'Realvis_XL',
|
| 55 |
+
'abyss_orange_mix',
|
| 56 |
+
'anything_v5',
|
| 57 |
+
'dreamshaper_xl',
|
| 58 |
+
'epic_realism',
|
| 59 |
+
'comicbook_style',
|
| 60 |
+
'newdawnxl',
|
| 61 |
+
'nextphoto',
|
| 62 |
+
'nightvisionxl',
|
| 63 |
+
'juggernaut',
|
| 64 |
+
'cyber_realistic',
|
| 65 |
+
'real_cartoon',
|
| 66 |
+
'unstable_diffusers',
|
| 67 |
+
'cant_believe',
|
| 68 |
+
'majicmix_fantasy',
|
| 69 |
+
'analog_madness',
|
| 70 |
+
'blazing_drive',
|
| 71 |
+
'mysteriousxl',
|
| 72 |
+
'night_sky',
|
| 73 |
+
'never_ending',
|
| 74 |
+
'dark_sushi',
|
| 75 |
+
'meina_pastel',
|
| 76 |
+
'meina_alter',
|
| 77 |
+
'counterfeitxl_v10',
|
| 78 |
+
'plagion_v10',
|
| 79 |
+
'replicant_v3.0'
|
| 80 |
]
|
| 81 |
|
| 82 |
return response
|
|
|
|
| 280 |
|
| 281 |
text_button.click(txt2img, inputs=[prompt, negative_prompt, model, steps, sampler, cfg_scale, width, height, seed], outputs=image_output)
|
| 282 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 283 |
|
| 284 |
demo.queue(max_size=80, api_open=False).launch(max_threads=256)
|