RioShiina commited on
Commit
fbfa802
·
verified ·
1 Parent(s): b1745b0

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. requirements.txt +6 -4
  2. ui/events.py +21 -21
  3. ui/layout.py +3 -3
requirements.txt CHANGED
@@ -1,7 +1,7 @@
1
- comfyui-frontend-package==1.33.10
2
- comfyui-workflow-templates==0.7.25
3
- comfyui-embedded-docs==0.3.1
4
- torch
5
  torchsde
6
  torchvision
7
  torchaudio
@@ -21,6 +21,8 @@ psutil
21
  alembic
22
  SQLAlchemy
23
  av>=14.2.0
 
 
24
 
25
  #non essential dependencies:
26
  kornia>=0.7.1
 
1
+ comfyui-frontend-package==1.37.11
2
+ comfyui-workflow-templates==0.8.24
3
+ comfyui-embedded-docs==0.4.0
4
+ torch==2.9.1
5
  torchsde
6
  torchvision
7
  torchaudio
 
21
  alembic
22
  SQLAlchemy
23
  av>=14.2.0
24
+ comfy-kitchen>=0.2.7
25
+ requests
26
 
27
  #non essential dependencies:
28
  kornia>=0.7.1
ui/events.py CHANGED
@@ -421,7 +421,7 @@ def attach_event_handlers(ui_components, demo):
421
 
422
 
423
  for prefix, task_type in [
424
- ("txt2img", "txt2img"), ("img2img", "img2img"),
425
  ("outpaint", "outpaint"), ("hires_fix", "hires_fix"),
426
  ]:
427
  if f'add_lora_button_{prefix}' in ui_components:
@@ -481,25 +481,25 @@ def attach_event_handlers(ui_components, demo):
481
  model_dropdown = ui_components[f'base_model_{prefix}']
482
  aspect_ratio_dropdown.change(fn=on_aspect_ratio_change, inputs=[aspect_ratio_dropdown, model_dropdown], outputs=[width_component, height_component], show_progress=False)
483
 
484
- # if 'view_mode_inpaint' in ui_components:
485
- # def toggle_inpaint_fullscreen_view(view_mode):
486
- # is_fullscreen = (view_mode == "Fullscreen View")
487
- # other_elements_visible = not is_fullscreen
488
- # editor_height = 800 if is_fullscreen else 272
489
- # return {
490
- # ui_components['model_and_run_row_inpaint']: gr.update(visible=other_elements_visible),
491
- # ui_components['prompts_column_inpaint']: gr.update(visible=other_elements_visible),
492
- # ui_components['params_and_gallery_row_inpaint']: gr.update(visible=other_elements_visible),
493
- # ui_components['accordion_wrapper_inpaint']: gr.update(visible=other_elements_visible),
494
- # ui_components['input_image_dict_inpaint']: gr.update(height=editor_height),
495
- # }
496
 
497
- # output_components = [
498
- # ui_components['model_and_run_row_inpaint'], ui_components['prompts_column_inpaint'],
499
- # ui_components['params_and_gallery_row_inpaint'], ui_components['accordion_wrapper_inpaint'],
500
- # ui_components['input_image_dict_inpaint']
501
- # ]
502
- # ui_components['view_mode_inpaint'].change(fn=toggle_inpaint_fullscreen_view, inputs=[ui_components['view_mode_inpaint']], outputs=output_components, show_progress=False)
503
 
504
  def initialize_all_cn_dropdowns():
505
  cn_config = load_controlnet_config()
@@ -521,7 +521,7 @@ def attach_event_handlers(ui_components, demo):
521
  break
522
 
523
  updates = {}
524
- for prefix in ["txt2img", "img2img", "outpaint", "hires_fix"]:
525
  if f'controlnet_types_{prefix}' in ui_components:
526
  for type_dd in ui_components[f'controlnet_types_{prefix}']:
527
  updates[type_dd] = gr.update(choices=all_types, value=default_type)
@@ -552,7 +552,7 @@ def attach_event_handlers(ui_components, demo):
552
  return all_updates
553
 
554
  all_load_outputs = []
555
- for prefix in ["txt2img", "img2img", "outpaint", "hires_fix"]:
556
  if f'controlnet_types_{prefix}' in ui_components:
557
  all_load_outputs.extend(ui_components[f'controlnet_types_{prefix}'])
558
  all_load_outputs.extend(ui_components[f'controlnet_series_{prefix}'])
 
421
 
422
 
423
  for prefix, task_type in [
424
+ ("txt2img", "txt2img"), ("img2img", "img2img"), ("inpaint", "inpaint"),
425
  ("outpaint", "outpaint"), ("hires_fix", "hires_fix"),
426
  ]:
427
  if f'add_lora_button_{prefix}' in ui_components:
 
481
  model_dropdown = ui_components[f'base_model_{prefix}']
482
  aspect_ratio_dropdown.change(fn=on_aspect_ratio_change, inputs=[aspect_ratio_dropdown, model_dropdown], outputs=[width_component, height_component], show_progress=False)
483
 
484
+ if 'view_mode_inpaint' in ui_components:
485
+ def toggle_inpaint_fullscreen_view(view_mode):
486
+ is_fullscreen = (view_mode == "Fullscreen View")
487
+ other_elements_visible = not is_fullscreen
488
+ editor_height = 800 if is_fullscreen else 272
489
+ return {
490
+ ui_components['model_and_run_row_inpaint']: gr.update(visible=other_elements_visible),
491
+ ui_components['prompts_column_inpaint']: gr.update(visible=other_elements_visible),
492
+ ui_components['params_and_gallery_row_inpaint']: gr.update(visible=other_elements_visible),
493
+ ui_components['accordion_wrapper_inpaint']: gr.update(visible=other_elements_visible),
494
+ ui_components['input_image_dict_inpaint']: gr.update(height=editor_height),
495
+ }
496
 
497
+ output_components = [
498
+ ui_components['model_and_run_row_inpaint'], ui_components['prompts_column_inpaint'],
499
+ ui_components['params_and_gallery_row_inpaint'], ui_components['accordion_wrapper_inpaint'],
500
+ ui_components['input_image_dict_inpaint']
501
+ ]
502
+ ui_components['view_mode_inpaint'].change(fn=toggle_inpaint_fullscreen_view, inputs=[ui_components['view_mode_inpaint']], outputs=output_components, show_progress=False)
503
 
504
  def initialize_all_cn_dropdowns():
505
  cn_config = load_controlnet_config()
 
521
  break
522
 
523
  updates = {}
524
+ for prefix in ["txt2img", "img2img", "inpaint", "outpaint", "hires_fix"]:
525
  if f'controlnet_types_{prefix}' in ui_components:
526
  for type_dd in ui_components[f'controlnet_types_{prefix}']:
527
  updates[type_dd] = gr.update(choices=all_types, value=default_type)
 
552
  return all_updates
553
 
554
  all_load_outputs = []
555
+ for prefix in ["txt2img", "img2img", "inpaint", "outpaint", "hires_fix"]:
556
  if f'controlnet_types_{prefix}' in ui_components:
557
  all_load_outputs.extend(ui_components[f'controlnet_types_{prefix}'])
558
  all_load_outputs.extend(ui_components[f'controlnet_series_{prefix}'])
ui/layout.py CHANGED
@@ -25,8 +25,8 @@ def build_ui(event_handler_function):
25
  gr.Markdown(
26
  "This demo is a streamlined version of the [Comfy web UI](https://github.com/RioShiina47/comfy-webui)'s ImgGen functionality. "
27
  "Other versions are also available: "
 
28
  "[Z-Image](https://huggingface.co/spaces/RioShiina/ImageGen-Z-Image), "
29
- "[NewBie-Image](https://huggingface.co/spaces/RioShiina/ImageGen-NewBie-Image), "
30
  "[Illstrious](https://huggingface.co/spaces/RioShiina/ImageGen-Illstrious), "
31
  "[NoobAI](https://huggingface.co/spaces/RioShiina/ImageGen-NoobAI), "
32
  "[Pony](https://huggingface.co/spaces/RioShiina/ImageGen-Pony1), "
@@ -42,8 +42,8 @@ def build_ui(event_handler_function):
42
  with gr.TabItem("Img2Img", id=1):
43
  ui_components.update(img2img_ui.create_ui())
44
 
45
- # with gr.TabItem("Inpaint", id=2):
46
- # ui_components.update(inpaint_ui.create_ui())
47
 
48
  with gr.TabItem("Outpaint", id=3):
49
  ui_components.update(outpaint_ui.create_ui())
 
25
  gr.Markdown(
26
  "This demo is a streamlined version of the [Comfy web UI](https://github.com/RioShiina47/comfy-webui)'s ImgGen functionality. "
27
  "Other versions are also available: "
28
+ "[FLUX.2](https://huggingface.co/spaces/RioShiina/ImageGen-FLUX.2), "
29
  "[Z-Image](https://huggingface.co/spaces/RioShiina/ImageGen-Z-Image), "
 
30
  "[Illstrious](https://huggingface.co/spaces/RioShiina/ImageGen-Illstrious), "
31
  "[NoobAI](https://huggingface.co/spaces/RioShiina/ImageGen-NoobAI), "
32
  "[Pony](https://huggingface.co/spaces/RioShiina/ImageGen-Pony1), "
 
42
  with gr.TabItem("Img2Img", id=1):
43
  ui_components.update(img2img_ui.create_ui())
44
 
45
+ with gr.TabItem("Inpaint", id=2):
46
+ ui_components.update(inpaint_ui.create_ui())
47
 
48
  with gr.TabItem("Outpaint", id=3):
49
  ui_components.update(outpaint_ui.create_ui())