Spaces:
Running
Running
daquanzhou
commited on
Commit
•
a263b49
1
Parent(s):
80669d0
update app
Browse files- app.py +54 -30
- custom_nodes/ComfyUI-Manager/prestartup_script.py +6 -6
app.py
CHANGED
@@ -5,6 +5,30 @@ from typing import Sequence, Mapping, Any, Union
|
|
5 |
import torch
|
6 |
import gradio as gr
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
def get_value_at_index(obj: Union[Sequence, Mapping], index: int) -> Any:
|
10 |
"""Returns the value at the given index of a sequence or mapping.
|
@@ -419,43 +443,43 @@ css = """
|
|
419 |
examples = [
|
420 |
# 1-ToonYou
|
421 |
[
|
422 |
-
"toonyou_beta3.safetensors",
|
423 |
-
"mm_sd_v14.ckpt",
|
424 |
"masterpiece, best quality, 1girl, solo, cherry blossoms, hanami, pink flower, white flower, spring season, wisteria, petals, flower, plum blossoms, outdoors, falling petals, white hair, black eyes",
|
425 |
"worst quality, low quality, nsfw, logo",
|
426 |
-
512, 512, "13204175718326964000"
|
427 |
],
|
428 |
# 2-Lyriel
|
429 |
[
|
430 |
-
"lyriel_v16.safetensors",
|
431 |
-
"mm_sd_v15.ckpt",
|
432 |
"A forbidden castle high up in the mountains, pixel art, intricate details2, hdr, intricate details, hyperdetailed5, natural skin texture, hyperrealism, soft light, sharp, game art, key visual, surreal",
|
433 |
"3d, cartoon, anime, sketches, worst quality, low quality, normal quality, lowres, normal quality, monochrome, grayscale, skin spots, acnes, skin blemishes, bad anatomy, girl, loli, young, large breasts, red eyes, muscular",
|
434 |
-
512, 512, "6681501646976930000"
|
435 |
],
|
436 |
# 3-RCNZ
|
437 |
[
|
438 |
-
"rcnzCartoon3d_v10.safetensors",
|
439 |
-
"mm_sd_v14.ckpt",
|
440 |
"Jane Eyre with headphones, natural skin texture,4mm,k textures, soft cinematic light, adobe lightroom, photolab, hdr, intricate, elegant, highly detailed, sharp focus, cinematic look, soothing tones, insane details, intricate details, hyperdetailed, low contrast, soft cinematic light, dim colors, exposure blend, hdr, faded",
|
441 |
"deformed, distorted, disfigured, poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, mutated hands and fingers, disconnected limbs, mutation, mutated, ugly, disgusting, blurry, amputation",
|
442 |
-
512, 512, "2416282124261060"
|
443 |
],
|
444 |
# 4-MajicMix
|
445 |
[
|
446 |
-
"majicmixRealistic_v5Preview.safetensors",
|
447 |
-
"mm_sd_v14.ckpt",
|
448 |
"1girl, offshoulder, light smile, shiny skin best quality, masterpiece, photorealistic",
|
449 |
"bad hand, worst quality, low quality, normal quality, lowres, bad anatomy, bad hands, watermark, moles",
|
450 |
-
512, 512, "7132772652786303"
|
451 |
],
|
452 |
# 5-RealisticVision
|
453 |
[
|
454 |
-
"realisticVisionV20_v20.safetensors",
|
455 |
-
"mm_sd_v15.ckpt",
|
456 |
"photo of coastline, rocks, storm weather, wind, waves, lightning, 8k uhd, dslr, soft lighting, high quality, film grain, Fujifilm XT3",
|
457 |
"blur, haze, deformed iris, deformed pupils, semi-realistic, cgi, 3d, render, sketch, cartoon, drawing, anime, mutated hands and fingers, deformed, distorted, disfigured, poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, disconnected limbs, mutation, mutated, ugly, disgusting, amputation",
|
458 |
-
512, 512, "1490157606650685400"
|
459 |
]
|
460 |
]
|
461 |
|
@@ -485,23 +509,23 @@ def ui():
|
|
485 |
)
|
486 |
with gr.Row():
|
487 |
with gr.Column():
|
488 |
-
base_model_dropdown = gr.Dropdown( label="Base DreamBooth Model", choices=c.base_model_list, value=c.base_model_list[0], interactive=True )
|
489 |
-
motion_module_dropdown = gr.Dropdown( label="Motion Module", choices=c.motion_module_list, value=c.motion_module_list[0], interactive=True )
|
490 |
|
491 |
-
base_model_dropdown.change(fn=c.update_base_model, inputs=[base_model_dropdown], outputs=[base_model_dropdown])
|
492 |
-
motion_module_dropdown.change(fn=c.update_motion_module, inputs=[motion_module_dropdown], outputs=[motion_module_dropdown])
|
493 |
|
494 |
prompt_textbox = gr.Textbox( label="Prompt", lines=3 )
|
495 |
negative_prompt_textbox = gr.Textbox( label="Negative Prompt", lines=3, value="worst quality, low quality, nsfw, logo")
|
496 |
|
497 |
-
with gr.Accordion("Advance", open=False):
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
|
506 |
generate_button = gr.Button( value="Generate", variant='primary' )
|
507 |
|
@@ -509,12 +533,12 @@ def ui():
|
|
509 |
result_video = gr.Video( label="Generated Animation", interactive=False )
|
510 |
json_config = gr.Json( label="Config", value=None )
|
511 |
|
512 |
-
inputs = [
|
513 |
outputs = [result_video, json_config]
|
514 |
|
515 |
generate_button.click( fn=c.run_once, inputs=inputs, outputs=outputs )
|
516 |
|
517 |
-
gr.Examples( fn=c.run_once
|
518 |
|
519 |
return demo
|
520 |
|
@@ -522,4 +546,4 @@ def ui():
|
|
522 |
if __name__ == "__main__":
|
523 |
demo = ui()
|
524 |
demo.queue(max_size=20)
|
525 |
-
demo.launch(
|
|
|
5 |
import torch
|
6 |
import gradio as gr
|
7 |
|
8 |
+
import logging.config
|
9 |
+
LOGGING_CONFIG = {
|
10 |
+
'version': 1,
|
11 |
+
'formatters': {
|
12 |
+
'default': { # This is the formatter named 'default'
|
13 |
+
'format': '%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
14 |
+
},
|
15 |
+
},
|
16 |
+
'handlers': {
|
17 |
+
'console': {
|
18 |
+
'class': 'logging.StreamHandler',
|
19 |
+
'formatter': 'default', # Reference to the 'default' formatter
|
20 |
+
},
|
21 |
+
},
|
22 |
+
'loggers': {
|
23 |
+
'': { # root logger
|
24 |
+
'handlers': ['console'],
|
25 |
+
'level': 'INFO',
|
26 |
+
},
|
27 |
+
},
|
28 |
+
}
|
29 |
+
|
30 |
+
# Assuming LOGGING_CONFIG is the dictionary defined above
|
31 |
+
logging.config.dictConfig(LOGGING_CONFIG)
|
32 |
|
33 |
def get_value_at_index(obj: Union[Sequence, Mapping], index: int) -> Any:
|
34 |
"""Returns the value at the given index of a sequence or mapping.
|
|
|
443 |
examples = [
|
444 |
# 1-ToonYou
|
445 |
[
|
446 |
+
# "toonyou_beta3.safetensors",
|
447 |
+
# "mm_sd_v14.ckpt",
|
448 |
"masterpiece, best quality, 1girl, solo, cherry blossoms, hanami, pink flower, white flower, spring season, wisteria, petals, flower, plum blossoms, outdoors, falling petals, white hair, black eyes",
|
449 |
"worst quality, low quality, nsfw, logo",
|
450 |
+
# 512, 512, "13204175718326964000"
|
451 |
],
|
452 |
# 2-Lyriel
|
453 |
[
|
454 |
+
# "lyriel_v16.safetensors",
|
455 |
+
# "mm_sd_v15.ckpt",
|
456 |
"A forbidden castle high up in the mountains, pixel art, intricate details2, hdr, intricate details, hyperdetailed5, natural skin texture, hyperrealism, soft light, sharp, game art, key visual, surreal",
|
457 |
"3d, cartoon, anime, sketches, worst quality, low quality, normal quality, lowres, normal quality, monochrome, grayscale, skin spots, acnes, skin blemishes, bad anatomy, girl, loli, young, large breasts, red eyes, muscular",
|
458 |
+
# 512, 512, "6681501646976930000"
|
459 |
],
|
460 |
# 3-RCNZ
|
461 |
[
|
462 |
+
# "rcnzCartoon3d_v10.safetensors",
|
463 |
+
# "mm_sd_v14.ckpt",
|
464 |
"Jane Eyre with headphones, natural skin texture,4mm,k textures, soft cinematic light, adobe lightroom, photolab, hdr, intricate, elegant, highly detailed, sharp focus, cinematic look, soothing tones, insane details, intricate details, hyperdetailed, low contrast, soft cinematic light, dim colors, exposure blend, hdr, faded",
|
465 |
"deformed, distorted, disfigured, poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, mutated hands and fingers, disconnected limbs, mutation, mutated, ugly, disgusting, blurry, amputation",
|
466 |
+
# 512, 512, "2416282124261060"
|
467 |
],
|
468 |
# 4-MajicMix
|
469 |
[
|
470 |
+
# "majicmixRealistic_v5Preview.safetensors",
|
471 |
+
# "mm_sd_v14.ckpt",
|
472 |
"1girl, offshoulder, light smile, shiny skin best quality, masterpiece, photorealistic",
|
473 |
"bad hand, worst quality, low quality, normal quality, lowres, bad anatomy, bad hands, watermark, moles",
|
474 |
+
# 512, 512, "7132772652786303"
|
475 |
],
|
476 |
# 5-RealisticVision
|
477 |
[
|
478 |
+
# "realisticVisionV20_v20.safetensors",
|
479 |
+
# "mm_sd_v15.ckpt",
|
480 |
"photo of coastline, rocks, storm weather, wind, waves, lightning, 8k uhd, dslr, soft lighting, high quality, film grain, Fujifilm XT3",
|
481 |
"blur, haze, deformed iris, deformed pupils, semi-realistic, cgi, 3d, render, sketch, cartoon, drawing, anime, mutated hands and fingers, deformed, distorted, disfigured, poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, disconnected limbs, mutation, mutated, ugly, disgusting, amputation",
|
482 |
+
# 512, 512, "1490157606650685400"
|
483 |
]
|
484 |
]
|
485 |
|
|
|
509 |
)
|
510 |
with gr.Row():
|
511 |
with gr.Column():
|
512 |
+
# base_model_dropdown = gr.Dropdown( label="Base DreamBooth Model", choices=c.base_model_list, value=c.base_model_list[0], interactive=True )
|
513 |
+
# motion_module_dropdown = gr.Dropdown( label="Motion Module", choices=c.motion_module_list, value=c.motion_module_list[0], interactive=True )
|
514 |
|
515 |
+
# base_model_dropdown.change(fn=c.update_base_model, inputs=[base_model_dropdown], outputs=[base_model_dropdown])
|
516 |
+
# motion_module_dropdown.change(fn=c.update_motion_module, inputs=[motion_module_dropdown], outputs=[motion_module_dropdown])
|
517 |
|
518 |
prompt_textbox = gr.Textbox( label="Prompt", lines=3 )
|
519 |
negative_prompt_textbox = gr.Textbox( label="Negative Prompt", lines=3, value="worst quality, low quality, nsfw, logo")
|
520 |
|
521 |
+
# with gr.Accordion("Advance", open=False):
|
522 |
+
# with gr.Row():
|
523 |
+
# width_slider = gr.Slider( label="Width", value=512, minimum=256, maximum=1024, step=64 )
|
524 |
+
# height_slider = gr.Slider( label="Height", value=512, minimum=256, maximum=1024, step=64 )
|
525 |
+
# with gr.Row():
|
526 |
+
# seed_textbox = gr.Textbox( label="Seed", value=-1)
|
527 |
+
# seed_button = gr.Button(value="\U0001F3B2", elem_classes="toolbutton")
|
528 |
+
# seed_button.click(fn=lambda: gr.Textbox.update(value=random.randint(1, 1e16)), inputs=[], outputs=[seed_textbox])
|
529 |
|
530 |
generate_button = gr.Button( value="Generate", variant='primary' )
|
531 |
|
|
|
533 |
result_video = gr.Video( label="Generated Animation", interactive=False )
|
534 |
json_config = gr.Json( label="Config", value=None )
|
535 |
|
536 |
+
inputs = [prompt_textbox, negative_prompt_textbox]
|
537 |
outputs = [result_video, json_config]
|
538 |
|
539 |
generate_button.click( fn=c.run_once, inputs=inputs, outputs=outputs )
|
540 |
|
541 |
+
# gr.Examples( fn=c.run_once, examples=examples, inputs=inputs, outputs=outputs, cache_examples=True )
|
542 |
|
543 |
return demo
|
544 |
|
|
|
546 |
if __name__ == "__main__":
|
547 |
demo = ui()
|
548 |
demo.queue(max_size=20)
|
549 |
+
demo.launch()
|
custom_nodes/ComfyUI-Manager/prestartup_script.py
CHANGED
@@ -273,13 +273,13 @@ try:
|
|
273 |
log_file.close()
|
274 |
|
275 |
|
276 |
-
if enable_file_logging:
|
277 |
-
|
278 |
-
|
279 |
|
280 |
-
|
281 |
-
else:
|
282 |
-
|
283 |
|
284 |
except Exception as e:
|
285 |
print(f"[ComfyUI-Manager] Logging failed: {e}")
|
|
|
273 |
log_file.close()
|
274 |
|
275 |
|
276 |
+
# if enable_file_logging:
|
277 |
+
# sys.stdout = ComfyUIManagerLogger(True)
|
278 |
+
# sys.stderr = ComfyUIManagerLogger(False)
|
279 |
|
280 |
+
# atexit.register(close_log)
|
281 |
+
# else:
|
282 |
+
# sys.stdout.close_log = lambda: None
|
283 |
|
284 |
except Exception as e:
|
285 |
print(f"[ComfyUI-Manager] Logging failed: {e}")
|