From 347cf5b0d93545c2b6f83f05f99ebc11a946a924 Mon Sep 17 00:00:00 2001 From: lllyasviel Date: Sun, 28 Jan 2024 17:56:59 -0800 Subject: [PATCH] i --- .../scripts/legacy_preprocessor_compiled.json | 2232 +++++++++++++++++ .../scripts/legacy_preprocessor_compiler.py | 205 ++ .../scripts/legacy_preprocessor_loader.py | 80 - .../scripts/legacy_preprocessors.py | 9 + 4 files changed, 2446 insertions(+), 80 deletions(-) create mode 100644 extensions-builtin/forge_legacy_preprocessors/scripts/legacy_preprocessor_compiled.json create mode 100644 extensions-builtin/forge_legacy_preprocessors/scripts/legacy_preprocessor_compiler.py delete mode 100644 extensions-builtin/forge_legacy_preprocessors/scripts/legacy_preprocessor_loader.py create mode 100644 extensions-builtin/forge_legacy_preprocessors/scripts/legacy_preprocessors.py diff --git a/extensions-builtin/forge_legacy_preprocessors/scripts/legacy_preprocessor_compiled.json b/extensions-builtin/forge_legacy_preprocessors/scripts/legacy_preprocessor_compiled.json new file mode 100644 index 00000000..2331370c --- /dev/null +++ b/extensions-builtin/forge_legacy_preprocessors/scripts/legacy_preprocessor_compiled.json @@ -0,0 +1,2232 @@ +{ + "none": { + "name": "none", + "call_function": "lambda x, *args, **kwargs: (x, True)", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 100, + "tag": null + }, + "invert (from white bg & black line)": { + "name": "invert (from white bg & black line)", + "call_function": "invert", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": null + }, + "animal_openpose": { + "name": "animal_openpose", + "call_function": "functools.partial(g_openpose_model.run_model, include_body=True, include_hand=False, include_face=False, use_animal_pose=True)", + "unload_function": "g_openpose_model.unload", + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "min": 64, + "max": 2048, + "value": 512 + }, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "OpenPose" + }, + "blur_gaussian": { + "name": "blur_gaussian", + "call_function": "blur_gaussian", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "value": 512, + "min": 64, + "max": 2048 + }, + "slider_1": { + "name": "Sigma", + "min": 0.01, + "max": 64.0, + "value": 9.0 + }, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Tile/Blur" + }, + "canny": { + "name": "canny", + "call_function": "canny", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "value": 512, + "min": 64, + "max": 2048 + }, + "slider_1": { + "name": "Canny Low Threshold", + "value": 100, + "min": 1, + "max": 255 + }, + "slider_2": { + "name": "Canny High Threshold", + "value": 200, + "min": 1, + "max": 255 + }, + "slider_3": null, + "priority": 100, + "tag": "Canny" + }, + "densepose (pruple bg & purple torso)": { + "name": "densepose (pruple bg & purple torso)", + "call_function": "functools.partial(densepose, cmap=\"viridis\")", + "unload_function": "unload_densepose", + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "min": 64, + "max": 2048, + "value": 512 + }, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "OpenPose" + }, + "densepose_parula (black bg & blue torso)": { + "name": "densepose_parula (black bg & blue torso)", + "call_function": "functools.partial(densepose, cmap=\"parula\")", + "unload_function": "unload_densepose", + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "min": 64, + "max": 2048, + "value": 512 + }, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "OpenPose" + }, + "depth_anything": { + "name": "depth_anything", + "call_function": "functools.partial(depth_anything, colored=False)", + "unload_function": "unload_depth_anything", + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Depth" + }, + "depth_hand_refiner": { + "name": "depth_hand_refiner", + "call_function": "g_hand_refiner_model.run_model", + "unload_function": "g_hand_refiner_model.unload", + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "value": 512, + "min": 64, + "max": 2048 + }, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Depth" + }, + "depth_leres": { + "name": "depth_leres", + "call_function": "functools.partial(leres, boost=False)", + "unload_function": "unload_leres", + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "min": 64, + "max": 2048, + "value": 512 + }, + "slider_1": { + "name": "Remove Near %", + "min": 0, + "max": 100, + "value": 0, + "step": 0.1 + }, + "slider_2": { + "name": "Remove Background %", + "min": 0, + "max": 100, + "value": 0, + "step": 0.1 + }, + "slider_3": null, + "priority": 0, + "tag": "Depth" + }, + "depth_leres++": { + "name": "depth_leres++", + "call_function": "functools.partial(leres, boost=True)", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "min": 64, + "max": 2048, + "value": 512 + }, + "slider_1": { + "name": "Remove Near %", + "min": 0, + "max": 100, + "value": 0, + "step": 0.1 + }, + "slider_2": { + "name": "Remove Background %", + "min": 0, + "max": 100, + "value": 0, + "step": 0.1 + }, + "slider_3": null, + "priority": 0, + "tag": "Depth" + }, + "depth_midas": { + "name": "depth_midas", + "call_function": "midas", + "unload_function": "unload_midas", + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "min": 64, + "max": 2048, + "value": 512 + }, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 100, + "tag": "Depth" + }, + "depth_zoe": { + "name": "depth_zoe", + "call_function": "zoe_depth", + "unload_function": "unload_zoe_depth", + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Depth" + }, + "dw_openpose_full": { + "name": "dw_openpose_full", + "call_function": "functools.partial(g_openpose_model.run_model, include_body=True, include_hand=True, include_face=True, use_dw_pose=True)", + "unload_function": "g_openpose_model.unload", + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "min": 64, + "max": 2048, + "value": 512 + }, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "OpenPose" + }, + "inpaint_global_harmonious": { + "name": "inpaint_global_harmonious", + "call_function": "identity", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Inpaint" + }, + "inpaint_only": { + "name": "inpaint_only", + "call_function": "identity", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 100, + "tag": "Inpaint" + }, + "inpaint_only+lama": { + "name": "inpaint_only+lama", + "call_function": "lama_inpaint", + "unload_function": "unload_lama_inpaint", + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Inpaint" + }, + "instant_id_face_embedding": { + "name": "instant_id_face_embedding", + "call_function": "functools.partial(g_insight_face_instant_id_model.run_model_instant_id, return_keypoints=False)", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Instant_ID" + }, + "instant_id_face_keypoints": { + "name": "instant_id_face_keypoints", + "call_function": "functools.partial(g_insight_face_instant_id_model.run_model_instant_id, return_keypoints=True)", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Instant_ID" + }, + "ip-adapter_clip_sd15": { + "name": "ip-adapter_clip_sd15", + "call_function": "functools.partial(clip, config='clip_h')", + "unload_function": "functools.partial(unload_clip, config='clip_h')", + "model_free": false, + "no_control_mode": true, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 100, + "tag": "IP-Adapter" + }, + "ip-adapter_clip_sdxl": { + "name": "ip-adapter_clip_sdxl", + "call_function": "functools.partial(clip, config='clip_g')", + "unload_function": "functools.partial(unload_clip, config='clip_g')", + "model_free": false, + "no_control_mode": true, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "IP-Adapter" + }, + "ip-adapter_clip_sdxl_plus_vith": { + "name": "ip-adapter_clip_sdxl_plus_vith", + "call_function": "functools.partial(clip, config='clip_h')", + "unload_function": "functools.partial(unload_clip, config='clip_h')", + "model_free": false, + "no_control_mode": true, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "IP-Adapter" + }, + "ip-adapter_face_id": { + "name": "ip-adapter_face_id", + "call_function": "g_insight_face_model.run_model", + "unload_function": null, + "model_free": false, + "no_control_mode": true, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "IP-Adapter" + }, + "ip-adapter_face_id_plus": { + "name": "ip-adapter_face_id_plus", + "call_function": "face_id_plus", + "unload_function": "functools.partial(unload_clip, config='clip_h')", + "model_free": false, + "no_control_mode": true, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "IP-Adapter" + }, + "lineart_anime": { + "name": "lineart_anime", + "call_function": "lineart_anime", + "unload_function": "unload_lineart_anime", + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Lineart" + }, + "lineart_anime_denoise": { + "name": "lineart_anime_denoise", + "call_function": "lineart_anime_denoise", + "unload_function": "unload_lineart_anime_denoise", + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Lineart" + }, + "lineart_coarse": { + "name": "lineart_coarse", + "call_function": "lineart_coarse", + "unload_function": "unload_lineart_coarse", + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Lineart" + }, + "lineart_realistic": { + "name": "lineart_realistic", + "call_function": "lineart", + "unload_function": "unload_lineart", + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Lineart" + }, + "lineart_standard (from white bg & black line)": { + "name": "lineart_standard (from white bg & black line)", + "call_function": "lineart_standard", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 100, + "tag": "Lineart" + }, + "mediapipe_face": { + "name": "mediapipe_face", + "call_function": "mediapipe_face", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "value": 512, + "min": 64, + "max": 2048 + }, + "slider_1": { + "name": "Max Faces", + "value": 1, + "min": 1, + "max": 10, + "step": 1 + }, + "slider_2": { + "name": "Min Face Confidence", + "value": 0.5, + "min": 0.01, + "max": 1.0, + "step": 0.01 + }, + "slider_3": null, + "priority": 0, + "tag": null + }, + "mlsd": { + "name": "mlsd", + "call_function": "mlsd", + "unload_function": "unload_mlsd", + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "min": 64, + "max": 2048, + "value": 512 + }, + "slider_1": { + "name": "MLSD Value Threshold", + "min": 0.01, + "max": 2.0, + "value": 0.1, + "step": 0.01 + }, + "slider_2": { + "name": "MLSD Distance Threshold", + "min": 0.01, + "max": 20.0, + "value": 0.1, + "step": 0.01 + }, + "slider_3": null, + "priority": 100, + "tag": "MLSD" + }, + "normal_bae": { + "name": "normal_bae", + "call_function": "normal_bae", + "unload_function": "unload_normal_bae", + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 100, + "tag": "NormalMap" + }, + "normal_midas": { + "name": "normal_midas", + "call_function": "midas_normal", + "unload_function": "unload_midas", + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "min": 64, + "max": 2048, + "value": 512 + }, + "slider_1": { + "name": "Normal Background Threshold", + "min": 0.0, + "max": 1.0, + "value": 0.4, + "step": 0.01 + }, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "NormalMap" + }, + "openpose": { + "name": "openpose", + "call_function": "functools.partial(g_openpose_model.run_model, include_body=True, include_hand=False, include_face=False)", + "unload_function": "g_openpose_model.unload", + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "min": 64, + "max": 2048, + "value": 512 + }, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "OpenPose" + }, + "openpose_face": { + "name": "openpose_face", + "call_function": "functools.partial(g_openpose_model.run_model, include_body=True, include_hand=False, include_face=True)", + "unload_function": "g_openpose_model.unload", + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "OpenPose" + }, + "openpose_faceonly": { + "name": "openpose_faceonly", + "call_function": "functools.partial(g_openpose_model.run_model, include_body=False, include_hand=False, include_face=True)", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "OpenPose" + }, + "openpose_full": { + "name": "openpose_full", + "call_function": "functools.partial(g_openpose_model.run_model, include_body=True, include_hand=True, include_face=True)", + "unload_function": "g_openpose_model.unload", + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "min": 64, + "max": 2048, + "value": 512 + }, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 100, + "tag": "OpenPose" + }, + "openpose_hand": { + "name": "openpose_hand", + "call_function": "functools.partial(g_openpose_model.run_model, include_body=True, include_hand=True, include_face=False)", + "unload_function": "g_openpose_model.unload", + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "OpenPose" + }, + "recolor_intensity": { + "name": "recolor_intensity", + "call_function": "recolor_intensity", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": { + "name": "Gamma Correction", + "value": 1.0, + "min": 0.1, + "max": 2.0, + "step": 0.001 + }, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Recolor" + }, + "recolor_luminance": { + "name": "recolor_luminance", + "call_function": "recolor_luminance", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": { + "name": "Gamma Correction", + "value": 1.0, + "min": 0.1, + "max": 2.0, + "step": 0.001 + }, + "slider_2": null, + "slider_3": null, + "priority": 100, + "tag": "Recolor" + }, + "reference_adain": { + "name": "reference_adain", + "call_function": "identity", + "unload_function": null, + "model_free": true, + "no_control_mode": false, + "resolution": null, + "slider_1": { + "name": "Style Fidelity (only for \"Balanced\" mode)", + "value": 0.5, + "min": 0.0, + "max": 1.0, + "step": 0.01 + }, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Reference" + }, + "reference_adain+attn": { + "name": "reference_adain+attn", + "call_function": "identity", + "unload_function": null, + "model_free": true, + "no_control_mode": false, + "resolution": null, + "slider_1": { + "name": "Style Fidelity (only for \"Balanced\" mode)", + "value": 0.5, + "min": 0.0, + "max": 1.0, + "step": 0.01 + }, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Reference" + }, + "reference_only": { + "name": "reference_only", + "call_function": "identity", + "unload_function": null, + "model_free": true, + "no_control_mode": false, + "resolution": null, + "slider_1": { + "name": "Style Fidelity (only for \"Balanced\" mode)", + "value": 0.5, + "min": 0.0, + "max": 1.0, + "step": 0.01 + }, + "slider_2": null, + "slider_3": null, + "priority": 100, + "tag": "Reference" + }, + "revision_clipvision": { + "name": "revision_clipvision", + "call_function": "functools.partial(clip, config='clip_g')", + "unload_function": "functools.partial(unload_clip, config='clip_g')", + "model_free": true, + "no_control_mode": true, + "resolution": null, + "slider_1": { + "name": "Noise Augmentation", + "value": 0.0, + "min": 0.0, + "max": 1.0 + }, + "slider_2": null, + "slider_3": null, + "priority": 100, + "tag": "Revision" + }, + "revision_ignore_prompt": { + "name": "revision_ignore_prompt", + "call_function": "functools.partial(clip, config='clip_g')", + "unload_function": "functools.partial(unload_clip, config='clip_g')", + "model_free": true, + "no_control_mode": true, + "resolution": null, + "slider_1": { + "name": "Noise Augmentation", + "value": 0.0, + "min": 0.0, + "max": 1.0 + }, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Revision" + }, + "scribble_hed": { + "name": "scribble_hed", + "call_function": "scribble_hed", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "min": 64, + "max": 2048, + "value": 512 + }, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Scribble/Sketch" + }, + "scribble_pidinet": { + "name": "scribble_pidinet", + "call_function": "scribble_pidinet", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 100, + "tag": "Scribble/Sketch" + }, + "scribble_xdog": { + "name": "scribble_xdog", + "call_function": "scribble_xdog", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "value": 512, + "min": 64, + "max": 2048 + }, + "slider_1": { + "name": "XDoG Threshold", + "min": 1, + "max": 64, + "value": 32 + }, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Scribble/Sketch" + }, + "seg_anime_face": { + "name": "seg_anime_face", + "call_function": "anime_face_segment", + "unload_function": "unload_anime_face_segment", + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "value": 512, + "min": 64, + "max": 2048 + }, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Segmentation" + }, + "seg_ofade20k": { + "name": "seg_ofade20k", + "call_function": "oneformer_ade20k", + "unload_function": "unload_oneformer_ade20k", + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 100, + "tag": "Segmentation" + }, + "seg_ofcoco": { + "name": "seg_ofcoco", + "call_function": "oneformer_coco", + "unload_function": "unload_oneformer_coco", + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Segmentation" + }, + "seg_ufade20k": { + "name": "seg_ufade20k", + "call_function": "uniformer", + "unload_function": "unload_uniformer", + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "min": 64, + "max": 2048, + "value": 512 + }, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Segmentation" + }, + "shuffle": { + "name": "shuffle", + "call_function": "shuffle", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 100, + "tag": "Shuffle" + }, + "softedge_hed": { + "name": "softedge_hed", + "call_function": "hed", + "unload_function": "unload_hed", + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "min": 64, + "max": 2048, + "value": 512 + }, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "SoftEdge" + }, + "softedge_hedsafe": { + "name": "softedge_hedsafe", + "call_function": "hed_safe", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "min": 64, + "max": 2048, + "value": 512 + }, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "SoftEdge" + }, + "softedge_pidinet": { + "name": "softedge_pidinet", + "call_function": "pidinet", + "unload_function": "unload_pidinet", + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 100, + "tag": "SoftEdge" + }, + "softedge_pidisafe": { + "name": "softedge_pidisafe", + "call_function": "pidinet_safe", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "SoftEdge" + }, + "softedge_teed": { + "name": "softedge_teed", + "call_function": "te_hed", + "unload_function": "unload_te_hed", + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "value": 512, + "min": 64, + "max": 2048 + }, + "slider_1": { + "name": "Safe Steps", + "min": 0, + "max": 10, + "value": 2, + "step": 1 + }, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "SoftEdge" + }, + "t2ia_color_grid": { + "name": "t2ia_color_grid", + "call_function": "color", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "value": 512, + "min": 64, + "max": 2048 + }, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "T2I-Adapter" + }, + "t2ia_sketch_pidi": { + "name": "t2ia_sketch_pidi", + "call_function": "pidinet_ts", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "T2I-Adapter" + }, + "t2ia_style_clipvision": { + "name": "t2ia_style_clipvision", + "call_function": "functools.partial(clip, config='clip_vitl')", + "unload_function": "functools.partial(unload_clip, config='clip_vitl')", + "model_free": false, + "no_control_mode": true, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "T2I-Adapter" + }, + "threshold": { + "name": "threshold", + "call_function": "threshold", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "value": 512, + "min": 64, + "max": 2048 + }, + "slider_1": { + "name": "Binarization Threshold", + "min": 0, + "max": 255, + "value": 127 + }, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": null + }, + "tile_colorfix": { + "name": "tile_colorfix", + "call_function": "identity", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": { + "name": "Variation", + "value": 8.0, + "min": 3.0, + "max": 32.0, + "step": 1.0 + }, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Tile/Blur" + }, + "tile_colorfix+sharp": { + "name": "tile_colorfix+sharp", + "call_function": "identity", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": { + "name": "Variation", + "value": 8.0, + "min": 3.0, + "max": 32.0, + "step": 1.0 + }, + "slider_2": { + "name": "Sharpness", + "value": 1.0, + "min": 0.0, + "max": 2.0, + "step": 0.01 + }, + "slider_3": null, + "priority": 0, + "tag": "Tile/Blur" + }, + "tile_resample": { + "name": "tile_resample", + "call_function": "tile_resample", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": { + "name": "Down Sampling Rate", + "value": 1.0, + "min": 1.0, + "max": 8.0, + "step": 0.01 + }, + "slider_2": null, + "slider_3": null, + "priority": 100, + "tag": "Tile/Blur" + } +} +{ + "none": { + "name": "none", + "call_function": "lambda x, *args, **kwargs: (x, True)", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 100, + "tag": null + }, + "invert (from white bg & black line)": { + "name": "invert (from white bg & black line)", + "call_function": "invert", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": null + }, + "animal_openpose": { + "name": "animal_openpose", + "call_function": "functools.partial(g_openpose_model.run_model, include_body=True, include_hand=False, include_face=False, use_animal_pose=True)", + "unload_function": "g_openpose_model.unload", + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "min": 64, + "max": 2048, + "value": 512 + }, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "OpenPose" + }, + "blur_gaussian": { + "name": "blur_gaussian", + "call_function": "blur_gaussian", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "value": 512, + "min": 64, + "max": 2048 + }, + "slider_1": { + "name": "Sigma", + "min": 0.01, + "max": 64.0, + "value": 9.0 + }, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Tile/Blur" + }, + "canny": { + "name": "canny", + "call_function": "canny", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "value": 512, + "min": 64, + "max": 2048 + }, + "slider_1": { + "name": "Canny Low Threshold", + "value": 100, + "min": 1, + "max": 255 + }, + "slider_2": { + "name": "Canny High Threshold", + "value": 200, + "min": 1, + "max": 255 + }, + "slider_3": null, + "priority": 100, + "tag": "Canny" + }, + "densepose (pruple bg & purple torso)": { + "name": "densepose (pruple bg & purple torso)", + "call_function": "functools.partial(densepose, cmap=\"viridis\")", + "unload_function": "unload_densepose", + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "min": 64, + "max": 2048, + "value": 512 + }, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "OpenPose" + }, + "densepose_parula (black bg & blue torso)": { + "name": "densepose_parula (black bg & blue torso)", + "call_function": "functools.partial(densepose, cmap=\"parula\")", + "unload_function": "unload_densepose", + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "min": 64, + "max": 2048, + "value": 512 + }, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "OpenPose" + }, + "depth_anything": { + "name": "depth_anything", + "call_function": "functools.partial(depth_anything, colored=False)", + "unload_function": "unload_depth_anything", + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Depth" + }, + "depth_hand_refiner": { + "name": "depth_hand_refiner", + "call_function": "g_hand_refiner_model.run_model", + "unload_function": "g_hand_refiner_model.unload", + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "value": 512, + "min": 64, + "max": 2048 + }, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Depth" + }, + "depth_leres": { + "name": "depth_leres", + "call_function": "functools.partial(leres, boost=False)", + "unload_function": "unload_leres", + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "min": 64, + "max": 2048, + "value": 512 + }, + "slider_1": { + "name": "Remove Near %", + "min": 0, + "max": 100, + "value": 0, + "step": 0.1 + }, + "slider_2": { + "name": "Remove Background %", + "min": 0, + "max": 100, + "value": 0, + "step": 0.1 + }, + "slider_3": null, + "priority": 0, + "tag": "Depth" + }, + "depth_leres++": { + "name": "depth_leres++", + "call_function": "functools.partial(leres, boost=True)", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "min": 64, + "max": 2048, + "value": 512 + }, + "slider_1": { + "name": "Remove Near %", + "min": 0, + "max": 100, + "value": 0, + "step": 0.1 + }, + "slider_2": { + "name": "Remove Background %", + "min": 0, + "max": 100, + "value": 0, + "step": 0.1 + }, + "slider_3": null, + "priority": 0, + "tag": "Depth" + }, + "depth_midas": { + "name": "depth_midas", + "call_function": "midas", + "unload_function": "unload_midas", + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "min": 64, + "max": 2048, + "value": 512 + }, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 100, + "tag": "Depth" + }, + "depth_zoe": { + "name": "depth_zoe", + "call_function": "zoe_depth", + "unload_function": "unload_zoe_depth", + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Depth" + }, + "dw_openpose_full": { + "name": "dw_openpose_full", + "call_function": "functools.partial(g_openpose_model.run_model, include_body=True, include_hand=True, include_face=True, use_dw_pose=True)", + "unload_function": "g_openpose_model.unload", + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "min": 64, + "max": 2048, + "value": 512 + }, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "OpenPose" + }, + "inpaint_global_harmonious": { + "name": "inpaint_global_harmonious", + "call_function": "identity", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Inpaint" + }, + "inpaint_only": { + "name": "inpaint_only", + "call_function": "identity", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 100, + "tag": "Inpaint" + }, + "inpaint_only+lama": { + "name": "inpaint_only+lama", + "call_function": "lama_inpaint", + "unload_function": "unload_lama_inpaint", + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Inpaint" + }, + "instant_id_face_embedding": { + "name": "instant_id_face_embedding", + "call_function": "functools.partial(g_insight_face_instant_id_model.run_model_instant_id, return_keypoints=False)", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Instant_ID" + }, + "instant_id_face_keypoints": { + "name": "instant_id_face_keypoints", + "call_function": "functools.partial(g_insight_face_instant_id_model.run_model_instant_id, return_keypoints=True)", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Instant_ID" + }, + "ip-adapter_clip_sd15": { + "name": "ip-adapter_clip_sd15", + "call_function": "functools.partial(clip, config='clip_h')", + "unload_function": "functools.partial(unload_clip, config='clip_h')", + "model_free": false, + "no_control_mode": true, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 100, + "tag": "IP-Adapter" + }, + "ip-adapter_clip_sdxl": { + "name": "ip-adapter_clip_sdxl", + "call_function": "functools.partial(clip, config='clip_g')", + "unload_function": "functools.partial(unload_clip, config='clip_g')", + "model_free": false, + "no_control_mode": true, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "IP-Adapter" + }, + "ip-adapter_clip_sdxl_plus_vith": { + "name": "ip-adapter_clip_sdxl_plus_vith", + "call_function": "functools.partial(clip, config='clip_h')", + "unload_function": "functools.partial(unload_clip, config='clip_h')", + "model_free": false, + "no_control_mode": true, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "IP-Adapter" + }, + "ip-adapter_face_id": { + "name": "ip-adapter_face_id", + "call_function": "g_insight_face_model.run_model", + "unload_function": null, + "model_free": false, + "no_control_mode": true, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "IP-Adapter" + }, + "ip-adapter_face_id_plus": { + "name": "ip-adapter_face_id_plus", + "call_function": "face_id_plus", + "unload_function": "functools.partial(unload_clip, config='clip_h')", + "model_free": false, + "no_control_mode": true, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "IP-Adapter" + }, + "lineart_anime": { + "name": "lineart_anime", + "call_function": "lineart_anime", + "unload_function": "unload_lineart_anime", + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Lineart" + }, + "lineart_anime_denoise": { + "name": "lineart_anime_denoise", + "call_function": "lineart_anime_denoise", + "unload_function": "unload_lineart_anime_denoise", + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Lineart" + }, + "lineart_coarse": { + "name": "lineart_coarse", + "call_function": "lineart_coarse", + "unload_function": "unload_lineart_coarse", + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Lineart" + }, + "lineart_realistic": { + "name": "lineart_realistic", + "call_function": "lineart", + "unload_function": "unload_lineart", + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Lineart" + }, + "lineart_standard (from white bg & black line)": { + "name": "lineart_standard (from white bg & black line)", + "call_function": "lineart_standard", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 100, + "tag": "Lineart" + }, + "mediapipe_face": { + "name": "mediapipe_face", + "call_function": "mediapipe_face", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "value": 512, + "min": 64, + "max": 2048 + }, + "slider_1": { + "name": "Max Faces", + "value": 1, + "min": 1, + "max": 10, + "step": 1 + }, + "slider_2": { + "name": "Min Face Confidence", + "value": 0.5, + "min": 0.01, + "max": 1.0, + "step": 0.01 + }, + "slider_3": null, + "priority": 0, + "tag": null + }, + "mlsd": { + "name": "mlsd", + "call_function": "mlsd", + "unload_function": "unload_mlsd", + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "min": 64, + "max": 2048, + "value": 512 + }, + "slider_1": { + "name": "MLSD Value Threshold", + "min": 0.01, + "max": 2.0, + "value": 0.1, + "step": 0.01 + }, + "slider_2": { + "name": "MLSD Distance Threshold", + "min": 0.01, + "max": 20.0, + "value": 0.1, + "step": 0.01 + }, + "slider_3": null, + "priority": 100, + "tag": "MLSD" + }, + "normal_bae": { + "name": "normal_bae", + "call_function": "normal_bae", + "unload_function": "unload_normal_bae", + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 100, + "tag": "NormalMap" + }, + "normal_midas": { + "name": "normal_midas", + "call_function": "midas_normal", + "unload_function": "unload_midas", + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "min": 64, + "max": 2048, + "value": 512 + }, + "slider_1": { + "name": "Normal Background Threshold", + "min": 0.0, + "max": 1.0, + "value": 0.4, + "step": 0.01 + }, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "NormalMap" + }, + "openpose": { + "name": "openpose", + "call_function": "functools.partial(g_openpose_model.run_model, include_body=True, include_hand=False, include_face=False)", + "unload_function": "g_openpose_model.unload", + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "min": 64, + "max": 2048, + "value": 512 + }, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "OpenPose" + }, + "openpose_face": { + "name": "openpose_face", + "call_function": "functools.partial(g_openpose_model.run_model, include_body=True, include_hand=False, include_face=True)", + "unload_function": "g_openpose_model.unload", + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "OpenPose" + }, + "openpose_faceonly": { + "name": "openpose_faceonly", + "call_function": "functools.partial(g_openpose_model.run_model, include_body=False, include_hand=False, include_face=True)", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "OpenPose" + }, + "openpose_full": { + "name": "openpose_full", + "call_function": "functools.partial(g_openpose_model.run_model, include_body=True, include_hand=True, include_face=True)", + "unload_function": "g_openpose_model.unload", + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "min": 64, + "max": 2048, + "value": 512 + }, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 100, + "tag": "OpenPose" + }, + "openpose_hand": { + "name": "openpose_hand", + "call_function": "functools.partial(g_openpose_model.run_model, include_body=True, include_hand=True, include_face=False)", + "unload_function": "g_openpose_model.unload", + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "OpenPose" + }, + "recolor_intensity": { + "name": "recolor_intensity", + "call_function": "recolor_intensity", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": { + "name": "Gamma Correction", + "value": 1.0, + "min": 0.1, + "max": 2.0, + "step": 0.001 + }, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Recolor" + }, + "recolor_luminance": { + "name": "recolor_luminance", + "call_function": "recolor_luminance", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": { + "name": "Gamma Correction", + "value": 1.0, + "min": 0.1, + "max": 2.0, + "step": 0.001 + }, + "slider_2": null, + "slider_3": null, + "priority": 100, + "tag": "Recolor" + }, + "reference_adain": { + "name": "reference_adain", + "call_function": "identity", + "unload_function": null, + "model_free": true, + "no_control_mode": false, + "resolution": null, + "slider_1": { + "name": "Style Fidelity (only for \"Balanced\" mode)", + "value": 0.5, + "min": 0.0, + "max": 1.0, + "step": 0.01 + }, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Reference" + }, + "reference_adain+attn": { + "name": "reference_adain+attn", + "call_function": "identity", + "unload_function": null, + "model_free": true, + "no_control_mode": false, + "resolution": null, + "slider_1": { + "name": "Style Fidelity (only for \"Balanced\" mode)", + "value": 0.5, + "min": 0.0, + "max": 1.0, + "step": 0.01 + }, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Reference" + }, + "reference_only": { + "name": "reference_only", + "call_function": "identity", + "unload_function": null, + "model_free": true, + "no_control_mode": false, + "resolution": null, + "slider_1": { + "name": "Style Fidelity (only for \"Balanced\" mode)", + "value": 0.5, + "min": 0.0, + "max": 1.0, + "step": 0.01 + }, + "slider_2": null, + "slider_3": null, + "priority": 100, + "tag": "Reference" + }, + "revision_clipvision": { + "name": "revision_clipvision", + "call_function": "functools.partial(clip, config='clip_g')", + "unload_function": "functools.partial(unload_clip, config='clip_g')", + "model_free": true, + "no_control_mode": true, + "resolution": null, + "slider_1": { + "name": "Noise Augmentation", + "value": 0.0, + "min": 0.0, + "max": 1.0 + }, + "slider_2": null, + "slider_3": null, + "priority": 100, + "tag": "Revision" + }, + "revision_ignore_prompt": { + "name": "revision_ignore_prompt", + "call_function": "functools.partial(clip, config='clip_g')", + "unload_function": "functools.partial(unload_clip, config='clip_g')", + "model_free": true, + "no_control_mode": true, + "resolution": null, + "slider_1": { + "name": "Noise Augmentation", + "value": 0.0, + "min": 0.0, + "max": 1.0 + }, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Revision" + }, + "scribble_hed": { + "name": "scribble_hed", + "call_function": "scribble_hed", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "min": 64, + "max": 2048, + "value": 512 + }, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Scribble/Sketch" + }, + "scribble_pidinet": { + "name": "scribble_pidinet", + "call_function": "scribble_pidinet", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 100, + "tag": "Scribble/Sketch" + }, + "scribble_xdog": { + "name": "scribble_xdog", + "call_function": "scribble_xdog", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "value": 512, + "min": 64, + "max": 2048 + }, + "slider_1": { + "name": "XDoG Threshold", + "min": 1, + "max": 64, + "value": 32 + }, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Scribble/Sketch" + }, + "seg_anime_face": { + "name": "seg_anime_face", + "call_function": "anime_face_segment", + "unload_function": "unload_anime_face_segment", + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "value": 512, + "min": 64, + "max": 2048 + }, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Segmentation" + }, + "seg_ofade20k": { + "name": "seg_ofade20k", + "call_function": "oneformer_ade20k", + "unload_function": "unload_oneformer_ade20k", + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 100, + "tag": "Segmentation" + }, + "seg_ofcoco": { + "name": "seg_ofcoco", + "call_function": "oneformer_coco", + "unload_function": "unload_oneformer_coco", + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Segmentation" + }, + "seg_ufade20k": { + "name": "seg_ufade20k", + "call_function": "uniformer", + "unload_function": "unload_uniformer", + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "min": 64, + "max": 2048, + "value": 512 + }, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Segmentation" + }, + "shuffle": { + "name": "shuffle", + "call_function": "shuffle", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 100, + "tag": "Shuffle" + }, + "softedge_hed": { + "name": "softedge_hed", + "call_function": "hed", + "unload_function": "unload_hed", + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "min": 64, + "max": 2048, + "value": 512 + }, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "SoftEdge" + }, + "softedge_hedsafe": { + "name": "softedge_hedsafe", + "call_function": "hed_safe", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "min": 64, + "max": 2048, + "value": 512 + }, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "SoftEdge" + }, + "softedge_pidinet": { + "name": "softedge_pidinet", + "call_function": "pidinet", + "unload_function": "unload_pidinet", + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 100, + "tag": "SoftEdge" + }, + "softedge_pidisafe": { + "name": "softedge_pidisafe", + "call_function": "pidinet_safe", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "SoftEdge" + }, + "softedge_teed": { + "name": "softedge_teed", + "call_function": "te_hed", + "unload_function": "unload_te_hed", + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "value": 512, + "min": 64, + "max": 2048 + }, + "slider_1": { + "name": "Safe Steps", + "min": 0, + "max": 10, + "value": 2, + "step": 1 + }, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "SoftEdge" + }, + "t2ia_color_grid": { + "name": "t2ia_color_grid", + "call_function": "color", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "value": 512, + "min": 64, + "max": 2048 + }, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "T2I-Adapter" + }, + "t2ia_sketch_pidi": { + "name": "t2ia_sketch_pidi", + "call_function": "pidinet_ts", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "T2I-Adapter" + }, + "t2ia_style_clipvision": { + "name": "t2ia_style_clipvision", + "call_function": "functools.partial(clip, config='clip_vitl')", + "unload_function": "functools.partial(unload_clip, config='clip_vitl')", + "model_free": false, + "no_control_mode": true, + "resolution": null, + "slider_1": null, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "T2I-Adapter" + }, + "threshold": { + "name": "threshold", + "call_function": "threshold", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": { + "name": "Preprocessor Resolution", + "value": 512, + "min": 64, + "max": 2048 + }, + "slider_1": { + "name": "Binarization Threshold", + "min": 0, + "max": 255, + "value": 127 + }, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": null + }, + "tile_colorfix": { + "name": "tile_colorfix", + "call_function": "identity", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": { + "name": "Variation", + "value": 8.0, + "min": 3.0, + "max": 32.0, + "step": 1.0 + }, + "slider_2": null, + "slider_3": null, + "priority": 0, + "tag": "Tile/Blur" + }, + "tile_colorfix+sharp": { + "name": "tile_colorfix+sharp", + "call_function": "identity", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": { + "name": "Variation", + "value": 8.0, + "min": 3.0, + "max": 32.0, + "step": 1.0 + }, + "slider_2": { + "name": "Sharpness", + "value": 1.0, + "min": 0.0, + "max": 2.0, + "step": 0.01 + }, + "slider_3": null, + "priority": 0, + "tag": "Tile/Blur" + }, + "tile_resample": { + "name": "tile_resample", + "call_function": "tile_resample", + "unload_function": null, + "model_free": false, + "no_control_mode": false, + "resolution": null, + "slider_1": { + "name": "Down Sampling Rate", + "value": 1.0, + "min": 1.0, + "max": 8.0, + "step": 0.01 + }, + "slider_2": null, + "slider_3": null, + "priority": 100, + "tag": "Tile/Blur" + } +} \ No newline at end of file diff --git a/extensions-builtin/forge_legacy_preprocessors/scripts/legacy_preprocessor_compiler.py b/extensions-builtin/forge_legacy_preprocessors/scripts/legacy_preprocessor_compiler.py new file mode 100644 index 00000000..6a069c16 --- /dev/null +++ b/extensions-builtin/forge_legacy_preprocessors/scripts/legacy_preprocessor_compiler.py @@ -0,0 +1,205 @@ +# This is a python script to convert all old preprocessors to new format. +# However, the old preprocessors are not very memory effective +# and eventually we should move all old preprocessors to new format manually +# see also the forge_preprocessor_normalbae/scripts/preprocessor_normalbae for +# how to make better implementation of preprocessors. +# No newer preprocessors should be written in this legacy way. + +import json +from legacy_preprocessors.preprocessor_meta import ui_preprocessor_keys, reverse_preprocessor_aliases, preprocessor_aliases +from legacy_preprocessors.preprocessor import model_free_preprocessors, no_control_mode_preprocessors, preprocessor_sliders_config, preprocessor_filters, preprocessor_filters_aliases + + +cn_preprocessor_modules = ''' + "none": lambda x, *args, **kwargs: (x, True), + "canny": canny, + "depth": midas, + "depth_leres": functools.partial(leres, boost=False), + "depth_leres++": functools.partial(leres, boost=True), + "depth_hand_refiner": g_hand_refiner_model.run_model, + "depth_anything": functools.partial(depth_anything, colored=False), + "hed": hed, + "hed_safe": hed_safe, + "mediapipe_face": mediapipe_face, + "mlsd": mlsd, + "normal_map": midas_normal, + "openpose": functools.partial(g_openpose_model.run_model, include_body=True, include_hand=False, include_face=False), + "openpose_hand": functools.partial(g_openpose_model.run_model, include_body=True, include_hand=True, include_face=False), + "openpose_face": functools.partial(g_openpose_model.run_model, include_body=True, include_hand=False, include_face=True), + "openpose_faceonly": functools.partial(g_openpose_model.run_model, include_body=False, include_hand=False, include_face=True), + "openpose_full": functools.partial(g_openpose_model.run_model, include_body=True, include_hand=True, include_face=True), + "dw_openpose_full": functools.partial(g_openpose_model.run_model, include_body=True, include_hand=True, include_face=True, use_dw_pose=True), + "animal_openpose": functools.partial(g_openpose_model.run_model, include_body=True, include_hand=False, include_face=False, use_animal_pose=True), + "clip_vision": functools.partial(clip, config='clip_vitl'), + "revision_clipvision": functools.partial(clip, config='clip_g'), + "revision_ignore_prompt": functools.partial(clip, config='clip_g'), + "ip-adapter_clip_sd15": functools.partial(clip, config='clip_h'), + "ip-adapter_clip_sdxl_plus_vith": functools.partial(clip, config='clip_h'), + "ip-adapter_clip_sdxl": functools.partial(clip, config='clip_g'), + "ip-adapter_face_id": g_insight_face_model.run_model, + "ip-adapter_face_id_plus": face_id_plus, + "instant_id_face_keypoints": functools.partial(g_insight_face_instant_id_model.run_model_instant_id, return_keypoints=True), + "instant_id_face_embedding": functools.partial(g_insight_face_instant_id_model.run_model_instant_id, return_keypoints=False), + "color": color, + "pidinet": pidinet, + "pidinet_safe": pidinet_safe, + "pidinet_sketch": pidinet_ts, + "pidinet_scribble": scribble_pidinet, + "scribble_xdog": scribble_xdog, + "scribble_hed": scribble_hed, + "segmentation": uniformer, + "threshold": threshold, + "depth_zoe": zoe_depth, + "normal_bae": normal_bae, + "oneformer_coco": oneformer_coco, + "oneformer_ade20k": oneformer_ade20k, + "lineart": lineart, + "lineart_coarse": lineart_coarse, + "lineart_anime": lineart_anime, + "lineart_standard": lineart_standard, + "shuffle": shuffle, + "tile_resample": tile_resample, + "invert": invert, + "lineart_anime_denoise": lineart_anime_denoise, + "reference_only": identity, + "reference_adain": identity, + "reference_adain+attn": identity, + "inpaint": identity, + "inpaint_only": identity, + "inpaint_only+lama": lama_inpaint, + "tile_colorfix": identity, + "tile_colorfix+sharp": identity, + "recolor_luminance": recolor_luminance, + "recolor_intensity": recolor_intensity, + "blur_gaussian": blur_gaussian, + "anime_face_segment": anime_face_segment, + "densepose": functools.partial(densepose, cmap="viridis"), + "densepose_parula": functools.partial(densepose, cmap="parula"), + "te_hed":te_hed, +''' + +cn_preprocessor_unloadable = ''' + "hed": unload_hed, + "fake_scribble": unload_hed, + "mlsd": unload_mlsd, + "clip_vision": functools.partial(unload_clip, config='clip_vitl'), + "revision_clipvision": functools.partial(unload_clip, config='clip_g'), + "revision_ignore_prompt": functools.partial(unload_clip, config='clip_g'), + "ip-adapter_clip_sd15": functools.partial(unload_clip, config='clip_h'), + "ip-adapter_clip_sdxl_plus_vith": functools.partial(unload_clip, config='clip_h'), + "ip-adapter_face_id_plus": functools.partial(unload_clip, config='clip_h'), + "ip-adapter_clip_sdxl": functools.partial(unload_clip, config='clip_g'), + "depth": unload_midas, + "depth_leres": unload_leres, + "depth_anything": unload_depth_anything, + "normal_map": unload_midas, + "pidinet": unload_pidinet, + "openpose": g_openpose_model.unload, + "openpose_hand": g_openpose_model.unload, + "openpose_face": g_openpose_model.unload, + "openpose_full": g_openpose_model.unload, + "dw_openpose_full": g_openpose_model.unload, + "animal_openpose": g_openpose_model.unload, + "segmentation": unload_uniformer, + "depth_zoe": unload_zoe_depth, + "normal_bae": unload_normal_bae, + "oneformer_coco": unload_oneformer_coco, + "oneformer_ade20k": unload_oneformer_ade20k, + "lineart": unload_lineart, + "lineart_coarse": unload_lineart_coarse, + "lineart_anime": unload_lineart_anime, + "lineart_anime_denoise": unload_lineart_anime_denoise, + "inpaint_only+lama": unload_lama_inpaint, + "anime_face_segment": unload_anime_face_segment, + "densepose": unload_densepose, + "densepose_parula": unload_densepose, + "depth_hand_refiner": g_hand_refiner_model.unload, + "te_hed":unload_te_hed, +''' + + +def compile_first_round(text): + lines = text.splitlines() + dd = {} + for l in lines: + sp = l.split('":') + if len(sp) == 2: + k, v = sp + k = k.strip(' ",') + v = v.strip(' ",') + dd[k] = v + return dd + + +cn_preprocessor_modules = compile_first_round(cn_preprocessor_modules) +cn_preprocessor_unloadable = compile_first_round(cn_preprocessor_unloadable) + + +def special_get(d, k, default=None): + k1 = k + k2 = preprocessor_aliases.get(k, k) + k3 = reverse_preprocessor_aliases.get(k, k) + + for pk in [k1, k2, k3]: + if pk in d: + return d[pk] + + return default + + +def special_judge_in(d, k): + k1 = k + k2 = preprocessor_aliases.get(k, k) + k3 = reverse_preprocessor_aliases.get(k, k) + + for pk in [k1, k2, k3]: + if pk in d: + return True + + return False + + +legacy_preprocessors = {} + +for name in ui_preprocessor_keys: + call_function = special_get(cn_preprocessor_modules, name, None) + assert call_function is not None + unload_function = special_get(cn_preprocessor_unloadable, name, None) + + model_free = special_judge_in(model_free_preprocessors, name) + no_control_mode = special_judge_in(no_control_mode_preprocessors, name) + slider_config = special_get(preprocessor_sliders_config, name, []) + + resolution = slider_config[0] if len(slider_config) > 0 else None + slider_1 = slider_config[1] if len(slider_config) > 1 else None + slider_2 = slider_config[2] if len(slider_config) > 2 else None + slider_3 = slider_config[3] if len(slider_config) > 3 else None + + legacy_preprocessors[name] = dict( + name=name, + call_function=call_function, + unload_function=unload_function, + model_free=model_free, + no_control_mode=no_control_mode, + resolution=resolution, + slider_1=slider_1, + slider_2=slider_2, + slider_3=slider_3, + priority=0, + tag=None + ) + + +for tag, best in preprocessor_filters.items(): + bp = special_get(legacy_preprocessors, best, None) + if bp is not None: + bp['priority'] = 100 + +for tag, best in preprocessor_filters.items(): + marks = [tag.lower()] + preprocessor_filters_aliases.get(tag.lower(), []) + for k, p in legacy_preprocessors.items(): + if any(x.lower() in k.lower() for x in marks): + p['tag'] = tag + +print(json.dumps(legacy_preprocessors, indent=4)) +a = 0 diff --git a/extensions-builtin/forge_legacy_preprocessors/scripts/legacy_preprocessor_loader.py b/extensions-builtin/forge_legacy_preprocessors/scripts/legacy_preprocessor_loader.py deleted file mode 100644 index e63ee5c7..00000000 --- a/extensions-builtin/forge_legacy_preprocessors/scripts/legacy_preprocessor_loader.py +++ /dev/null @@ -1,80 +0,0 @@ -from modules_forge.shared import Preprocessor, PreprocessorParameter, preprocessor_dir, add_preprocessor - -# This is a python script to convert all old preprocessors to new format. -# However, the old preprocessors are not very memory effective -# and eventually we should move all old preprocessors to new format manually -# see also the forge_preprocessor_normalbae/scripts/preprocessor_normalbae for -# how to make better implementation of preprocessors. -# No newer preprocessors should be written in this legacy way. - -from legacy_preprocessors.preprocessor_meta import cn_preprocessor_modules, cn_preprocessor_unloadable, ui_preprocessor_keys, reverse_preprocessor_aliases, preprocessor_aliases -from legacy_preprocessors.preprocessor import model_free_preprocessors, no_control_mode_preprocessors, preprocessor_sliders_config, preprocessor_filters, preprocessor_filters_aliases - - -def special_get(d, k, default=None): - k1 = k - k2 = preprocessor_aliases.get(k, k) - k3 = reverse_preprocessor_aliases.get(k, k) - - for pk in [k1, k2, k3]: - if pk in d: - return d[pk] - - return default - - -def special_judge_in(d, k): - k1 = k - k2 = preprocessor_aliases.get(k, k) - k3 = reverse_preprocessor_aliases.get(k, k) - - for pk in [k1, k2, k3]: - if pk in d: - return True - - return False - - -legacy_preprocessors = {} - -for name in ui_preprocessor_keys: - call_function = special_get(cn_preprocessor_modules, name, None) - assert call_function is not None - unload_function = special_get(cn_preprocessor_unloadable, name, None) - - model_free = special_judge_in(model_free_preprocessors, name) - no_control_mode = special_judge_in(no_control_mode_preprocessors, name) - slider_config = special_get(preprocessor_sliders_config, name, []) - - resolution = slider_config[0] if len(slider_config) > 0 else None - slider_1 = slider_config[1] if len(slider_config) > 1 else None - slider_2 = slider_config[2] if len(slider_config) > 2 else None - slider_3 = slider_config[3] if len(slider_config) > 3 else None - - legacy_preprocessors[name] = dict( - name=name, - call_function=call_function, - unload_function=unload_function, - model_free=model_free, - no_control_mode=no_control_mode, - resolution=resolution, - slider_1=slider_1, - slider_2=slider_2, - slider_3=slider_3, - priority=0, - tag=None - ) - - -for tag, best in preprocessor_filters.items(): - bp = special_get(legacy_preprocessors, best, None) - if bp is not None: - bp['priority'] = 100 - -for tag, best in preprocessor_filters.items(): - marks = [tag.lower()] + preprocessor_filters_aliases.get(tag.lower(), []) - for k, p in legacy_preprocessors.items(): - if any(x.lower() in k.lower() for x in marks): - p['tag'] = tag - -a = 0 diff --git a/extensions-builtin/forge_legacy_preprocessors/scripts/legacy_preprocessors.py b/extensions-builtin/forge_legacy_preprocessors/scripts/legacy_preprocessors.py new file mode 100644 index 00000000..72fc08ea --- /dev/null +++ b/extensions-builtin/forge_legacy_preprocessors/scripts/legacy_preprocessors.py @@ -0,0 +1,9 @@ +from modules_forge.shared import Preprocessor, PreprocessorParameter, preprocessor_dir, add_preprocessor + +# This is a python script to convert all old preprocessors to new format. +# However, the old preprocessors are not very memory effective +# and eventually we should move all old preprocessors to new format manually +# see also the forge_preprocessor_normalbae/scripts/preprocessor_normalbae for +# how to make better implementation of preprocessors. +# No newer preprocessors should be written in this legacy way. +