Download custom_nodes/dolphin_nodes/__init__.py from bjooo/tutorials: direct link, hf CLI and curl.
- Browser
- Download file 12.2 kB
-
https://huggingface.co/bjooo/tutorials/resolve/main/custom_nodes/dolphin_nodes/__init__.py
- Command line
-
hf download hf://bjooo/tutorials/custom_nodes/dolphin_nodes/__init__.py
-
curl -L -o __init__.py https://huggingface.co/bjooo/tutorials/resolve/main/custom_nodes/dolphin_nodes/__init__.py
12.2 kB
| import traceback | |
| NODE_CLASS_MAPPINGS = {} | |
| NODE_DISPLAY_NAME_MAPPINGS = {} | |
| WEB_DIRECTORY = "./web" | |
| def register_node(class_name, node_class, display_name): | |
| NODE_CLASS_MAPPINGS[class_name] = node_class | |
| NODE_DISPLAY_NAME_MAPPINGS[class_name] = display_name | |
| # 1. Wan Native Resize (์ด๋ฏธ์ง -> WAN ํด์๋ ๋ฆฌ์ฌ์ด์ฆ, ๋น์จ ์ ์ง + ์ ๋ ฌ) | |
| try: | |
| from .wan_resizer import WanNativeResize_Dolphin | |
| register_node("WanNativeResize_Dolphin", WanNativeResize_Dolphin, | |
| "๐ฌ Wan Native Resize (Dolphin)") | |
| except Exception: | |
| print(f"\nโ [Dolphin] Wan Resize ๋ก๋ ์คํจ:\n{traceback.format_exc()}") | |
| # 2. Story Splitter V32 (ํ ์คํธ ์์ฌ -> 4์ท ํ๋กฌํํธ ๋ถ๋ฐฐ) | |
| try: | |
| from .promp_logic_v32_story import DolphinMultiActionPromptNode_V32 | |
| register_node("DolphinMultiActionPromptNode_V32", DolphinMultiActionPromptNode_V32, | |
| "๐ฌ Dolphin Story Splitter V32") | |
| except Exception: | |
| print(f"\nโ [Dolphin] V32 Story Splitter ๋ก๋ ์คํจ:\n{traceback.format_exc()}") | |
| # 3. Architect V16 (ํด๋ฆฝ๋ณ LoRA -> TripleKSampler, model-only) | |
| try: | |
| from .arch_logic_v16 import DolphinTripleLoraMatrix as DolphinArchitectV16 | |
| register_node("DolphinArchitectV16", DolphinArchitectV16, | |
| "๐ฌ Dolphin Architect V16") | |
| except Exception: | |
| print(f"\nโ [Dolphin] Architect V16 ๋ก๋ ์คํจ:\n{traceback.format_exc()}") | |
| # 4. Cinematic Director (์ฌ์ธ์: ์คํ ๋ฆฌ ๋ถ๋ฐฐ + ํด๋ฆฝ๋ณ ๋ก๋ผ + ํธ๋ฆฌ๊ฑฐ ์ฃผ์ ) | |
| try: | |
| from .dolphin_director import DolphinCinematicDirector | |
| register_node("DolphinCinematicDirector", DolphinCinematicDirector, | |
| "๐ฌ Dolphin Cinematic Director (All-in-One)") | |
| except Exception: | |
| print(f"\nโ [Dolphin] Cinematic Director ๋ก๋ ์คํจ:\n{traceback.format_exc()}") | |
| # 5. Vision Director (์ด๋ฏธ์ง ์ธ์ + ํ์๋์ + ํด๋ฆฝ๋น ๋ก๋ผ 4๊ฐ) | |
| try: | |
| from .dolphin_vision_director import DolphinVisionDirector | |
| register_node("DolphinVisionDirector", DolphinVisionDirector, | |
| "๐ฌ๐ Dolphin Vision Director (Imageโ4Clips)") | |
| except Exception: | |
| print(f"\nโ [Dolphin] Vision Director ๋ก๋ ์คํจ:\n{traceback.format_exc()}") | |
| # 6. Architect V15 (arch_logic_v16 ์ด์ ๊ตฌ๋ฒ์ , model_base/high/low + clip ๊ฐ๋ณ ์ ๋ ฅ) | |
| try: | |
| from .arch_logic import DolphinArchitectV15 | |
| register_node("DolphinArchitectV15", DolphinArchitectV15, | |
| "๐ฌ Dolphin Architect V15 (legacy)") | |
| except Exception: | |
| print(f"\nโ [Dolphin] Architect V15 ๋ก๋ ์คํจ:\n{traceback.format_exc()}") | |
| # 7. Story Splitter V28 (V32 ์ด์ ๊ตฌ๋ฒ์ , stitch ๋ฐฉ์) | |
| try: | |
| from .promp_logic_v28_stitch import DolphinMultiActionPromptNode_V28 | |
| register_node("DolphinMultiActionPromptNode_V28", DolphinMultiActionPromptNode_V28, | |
| "๐ฌ Dolphin Story Splitter V28 (legacy)") | |
| except Exception: | |
| print(f"\nโ [Dolphin] V28 Story Splitter ๋ก๋ ์คํจ:\n{traceback.format_exc()}") | |
| # 8. Story Splitter V30 (V32 ์ด์ ๊ตฌ๋ฒ์ ) | |
| try: | |
| from .promp_logic_v30_story import DolphinMultiActionPromptNode_V30 | |
| register_node("DolphinMultiActionPromptNode_V30", DolphinMultiActionPromptNode_V30, | |
| "๐ฌ Dolphin Story Splitter V30 (legacy)") | |
| except Exception: | |
| print(f"\nโ [Dolphin] V30 Story Splitter ๋ก๋ ์คํจ:\n{traceback.format_exc()}") | |
| # 9. Prompt V32 Vision (promp_logic_v32_story.py์ DolphinMultiActionPromptNode_V32์ | |
| # ํด๋์ค๋ช ์ด ๋์ผํด์ ์ถฉ๋ โ ๋ฑ๋ก ํค/ํด๋์ค๋ช ์ _Vision์ผ๋ก ๊ตฌ๋ถํด์ ๋ ๋ค ์ด๋ฆผ) | |
| try: | |
| from .promp_logic_v32_vision import DolphinMultiActionPromptNode_V32 as DolphinMultiActionPromptNode_V32_Vision | |
| register_node("DolphinMultiActionPromptNode_V32_Vision", DolphinMultiActionPromptNode_V32_Vision, | |
| "๐ฌ Dolphin Prompt V32 Vision (legacy)") | |
| except Exception: | |
| print(f"\nโ [Dolphin] V32 Vision ๋ก๋ ์คํจ:\n{traceback.format_exc()}") | |
| # 10. Match Image & Mask Size (์ธํ์ธํธ ๋ธ๋ ๋์ฉ: ์ด๋ฏธ์ง/๋ง์คํฌ๋ฅผ ์ฐธ์กฐ ์ด๋ฏธ์ง ์ค์ ํฌ๊ธฐ์ ๋ง์ถค) | |
| try: | |
| from .match_size import MatchImageAndMaskSize_Dolphin | |
| register_node("MatchImageAndMaskSize_Dolphin", MatchImageAndMaskSize_Dolphin, | |
| "๐ฌ Match Image & Mask Size (Dolphin)") | |
| except Exception: | |
| print(f"\nโ [Dolphin] Match Image & Mask Size ๋ก๋ ์คํจ:\n{traceback.format_exc()}") | |
| # 11. Mask-Region Color Match (์ธํ์ธํธ ๋ง์คํฌ ์์ญ๋ง ๊ตญ์์ ์ผ๋ก ์๋ณด์ ) | |
| try: | |
| from .mask_region_color_match import MaskRegionColorMatch_Dolphin | |
| register_node("MaskRegionColorMatch_Dolphin", MaskRegionColorMatch_Dolphin, | |
| "๐ฌ Mask-Region Color Match (Dolphin)") | |
| except Exception: | |
| print(f"\nโ [Dolphin] Mask-Region Color Match ๋ก๋ ์คํจ:\n{traceback.format_exc()}") | |
| # 12. Prompt Director (Vision Director์ ๋์ผํ ๋น์ +LLM ์์ง, MODEL/LoRA ์ ๋ถ ์ ๊ฑฐ - | |
| # ํ๋กฌํํธ ๋ถ๋ฐฐ๋ง. ๋ก๋ผ/๋ชจ๋ธ์ Architect V16 ๋ฑ ๋ณ๋ ๋ ธ๋์์ ์ฒ๋ฆฌํ๋ค๋ ์ ์ ) | |
| try: | |
| from .dolphin_prompt_director import ( | |
| DolphinPromptDirector, DolphinPromptDirectorSingle, DolphinActionSplitter, | |
| ) | |
| register_node("DolphinPromptDirector", DolphinPromptDirector, | |
| "๐ฌ๐ Dolphin Prompt Director (ImageโN Prompts, no model/LoRA)") | |
| register_node("DolphinPromptDirectorSingle", DolphinPromptDirectorSingle, | |
| "๐ฌ๐ Dolphin Prompt Director (Single, Imageโ1 Prompt)") | |
| register_node("DolphinActionSplitter", DolphinActionSplitter, | |
| "โ๏ธ Dolphin Action Splitter (deterministic, no LLM)") | |
| except Exception: | |
| print(f"\nโ [Dolphin] Prompt Director ๋ก๋ ์คํจ:\n{traceback.format_exc()}") | |
| # 13. WanImageToVideoSVIPro mask ๋ฒ๊ทธ ์์ ํ (comfyui-kjnodes ์๋ณธ์ motion_latent_count๋ก | |
| # ์ด์ด๋ถ์ธ ๋ชจ์ ์ปจํ ์คํธ ํ๋ ์์ concat_mask์์ "known"์ผ๋ก ํ์ํ์ง ์์์, ํด๋ฆฝ | |
| # ๊ฒฝ๊ณ์์ ๋ช ํ๋ ์ ๋ฐ๋ณต ํ ์ ํ ๋ค๋ฅธ ์์์ผ๋ก ํ๋ ๋ฌธ์ ๊ฐ ์์์. anchor+motion ํ๋ ์ | |
| # ์ ์ฒด๋ฅผ known(0.0)์ผ๋ก ๋ง์คํนํ๋๋ก ์์ .) | |
| try: | |
| from .wan_svipro_fixed import WanImageToVideoSVIProFixed_Dolphin | |
| register_node("WanImageToVideoSVIProFixed_Dolphin", WanImageToVideoSVIProFixed_Dolphin, | |
| "๐ฌ Wan I2V SVIPro (motion-mask fix)") | |
| except Exception: | |
| print(f"\nโ [Dolphin] SVIPro Fixed ๋ก๋ ์คํจ:\n{traceback.format_exc()}") | |
| # 14. Wan I2V Continuity (์ฝ์ด WanImageToVideo ๋ฐฉ์ = known ํ๋ ์ ์ฌ๋ฌ ์ฅ์ ํ์ filler์ | |
| # ํจ๊ป ํ ๋ฒ์ ํต์ง VAE ์ธ์ฝ๋ฉ โ latent ๋ฌธ๋งฅ ์ผ๊ด์ฑ ๋ณด์ฅ. SVIPro์ raw latent ์คํ๋ผ์ด์ฑ์ | |
| # ํ์ง ํ/๋ถ์ฐ์ ๋ฌธ์ ๋ฅผ ํํผ. PainterI2V์ motion_amplitude(์ฌ๋ก์ฐ๋ชจ์ ๋ฐฉ์ง) ์ด์.) | |
| try: | |
| from .wan_i2v_continuity import WanI2VContinuity_Dolphin | |
| register_node("WanI2VContinuity_Dolphin", WanI2VContinuity_Dolphin, | |
| "๐ฌ Wan I2V Continuity (multi-frame + amplitude)") | |
| except Exception: | |
| print(f"\nโ [Dolphin] Wan I2V Continuity ๋ก๋ ์คํจ:\n{traceback.format_exc()}") | |
| # 15. SVIPro ๋๋กญ์ธ ๊ต์ฒด (์ฌ๋ก์ฐ๋ชจ์ ์์ ). ์๋ณธ์ filler๋ฅผ latent ๊ณต๊ฐ์์ | |
| # Wan21().process_out(zeros) = latents_mean ์์๋ก ์ฑ์์ "๋ณํ ์์" ์ ํธ๋ฅผ ์ฃผ๊ณ | |
| # ๋ถํฌ ๋ฐ ์ ๋ ฅ์ด ๋์ -> ์ฝ์ด WanImageToVideo/PainterI2V์ฒ๋ผ ํ์(0.5) ํฝ์ ์ VAE | |
| # ์ธ์ฝ๋ฉํ filler๋ก ๊ต์ฒด. ๋ง์คํฌ ๋ฒ๊ทธ(anchor 1ํ๋ ์๋ง known)๋ ํจ๊ป ์์ . | |
| try: | |
| from .wan_svipro_gray import WanImageToVideoSVIProGray_Dolphin | |
| register_node("WanImageToVideoSVIProGray_Dolphin", WanImageToVideoSVIProGray_Dolphin, | |
| "๐ฌ Wan I2V SVIPro (gray filler, slow-motion fix)") | |
| except Exception: | |
| print(f"\nโ [Dolphin] SVIPro Gray ๋ก๋ ์คํจ:\n{traceback.format_exc()}") | |
| # 16. SVIPro ๋๋กญ์ธ ๊ต์ฒด (๋ชจ์ ์ฆํญํ). 15๋ฒ(gray)๊ณผ ๋ฌ๋ฆฌ ํจ๋ฉยท๋ง์คํฌ๋ ์๋ฅ ์๋ณธ ๊ทธ๋๋ก ๋๊ณ | |
| # PainterI2V์ diff ์ฆํญ๋ง ์น๋๋ค โ SVI Pro LoRA๊ฐ ์๋ณธ ๊ท์ฝ ์์์ ํ์ต๋๊ธฐ ๋๋ฌธ. | |
| # high/low conditioning์ ๋ฐ๋ก ๋ฝ์์ ๋ชจ์ ์ฆํญ์ high-noise ์คํ ์ด์ง์๋ง ๋จน์ธ๋ค. | |
| # motion_amplitude=1.0์ด๋ฉด ์๋ฅ ์๋ณธ๊ณผ ์ถ๋ ฅ์ด ๋์ผ(ํ๊ท ํ์ธ์ฉ). | |
| try: | |
| from .wan_svipro_motion import WanImageToVideoSVIProMotion_Dolphin | |
| register_node("WanImageToVideoSVIProMotion_Dolphin", WanImageToVideoSVIProMotion_Dolphin, | |
| "๐ฌ Wan I2V SVIPro (motion amplitude, hi/lo split)") | |
| except Exception: | |
| print(f"\nโ [Dolphin] SVIPro Motion ๋ก๋ ์คํจ:\n{traceback.format_exc()}") | |
| # 17. ๋์คํฌ ๋ ธ๋ ์บ์ (๋ ธ๋๊ฐ ์๋๋ผ ComfyUI cache provider ๋ฑ๋ก). | |
| # ์๋/ํ๋กฌํํธ/์ด๋ฏธ์ง๊ฐ ๊ฐ์ผ๋ฉด ์ฌ์์ ํ์๋ JoyCaption~์ํ๋ฌ ์ฒด์ธ์ ์คํตํ๊ณ | |
| # ๋์คํฌ์์ ๊ฒฐ๊ณผ ๋ณต์. RAM_PRESSURE ๋ชจ๋์ ์บ์ ์ฆ๋ฐ๋ ๋์คํฌ์์ ์๋ ๋ณต๊ตฌ. | |
| try: | |
| from . import disk_cache_provider | |
| disk_cache_provider.register() | |
| except Exception: | |
| print(f"\nโ [Dolphin] ๋์คํฌ ๋ ธ๋ ์บ์ ๋ก๋ ์คํจ (๊ตฌ๋ฒ์ ComfyUI์ provider API ์์):\n{traceback.format_exc()}") | |
| # 18. Batch Seed Controller (4ํด๋ฆฝ ์์ ์ํ๋ฌ ์๋๋ฅผ ํ ๋ ธ๋์์ ์ค์์นญ: | |
| # ๊ณ ์ /์ ์ฒด๋๋ค/ํน์ ํด๋ฆฝ๋ง์ฌ์์ฑ). | |
| try: | |
| from .dolphin_seed_controller import DolphinBatchSeedController | |
| register_node("DolphinBatchSeedController", DolphinBatchSeedController, | |
| "๐ฒ Dolphin Batch Seed Controller (random-all / regen-from-clip)") | |
| except Exception: | |
| print(f"\nโ [Dolphin] Batch Seed Controller ๋ก๋ ์คํจ:\n{traceback.format_exc()}") | |
| # 19. LoRA Prompt Weaver (์์ฑ๋ ํด๋ฆฝ ํ๋กฌํํธ๋ฅผ "๊ทธ ํด๋ฆฝ์ ๊ฑธ๋ฆฌ๋ ๋ก๋ผ๋ค์ด ์ ๋ฐํํ๋๋ก" | |
| # ๋ค์ ์ฐ๋ ํ์ฒ๋ฆฌ ๋ ธ๋. ๋ก๋ผ ์ฌ์ด๋์นด(.metadata.json)์ ์ค๋ช /ํ๊ทธ/ํ์ต์บก์ ์ LLM์ | |
| # ๋จผ์ ์ฃผ๊ณ , ํธ๋ฆฌ๊ฑฐ๋ฅผ ๋ฌธ์ฅ ์ ํด๋น ๋ถ์์ ๋ถ์ฌ์ ์ฌ์์ฑํ๋ค - ์์ ์ฒ๋ผ ์ด๋ฆ ์์ | |
| # ์ฝค๋ง๋ก ๋์ดํ๋ฉด bounce/swing ๊ฐ์ ๋ฒ์ฉ ๋์ฌ๊ฐ ์ ์ ๋ชจ์ ์ผ๋ก ์๊ธฐ ๋๋ฌธ. | |
| # ๊ธฐ์กด ๋ ธ๋๋ ๊ฑด๋๋ฆฌ์ง ์๊ณ ๋ค์ ๋ผ์ ๋ฃ๋ ๋ฐฉ์์ด๋ผ ์ด๋ค ํ๋กฌํํธ ์์ค์๋ ๋ถ๋๋ค.) | |
| try: | |
| from .dolphin_lora_prompt import DolphinLoraPromptWeaver | |
| register_node("DolphinLoraPromptWeaver", DolphinLoraPromptWeaver, | |
| "๐งฌ Dolphin LoRA Prompt Weaver (ํ๋กฌํํธโ๋ก๋ผ์ ๋ง๊ฒ ์ฌ์์ฑ)") | |
| except Exception: | |
| print(f"\nโ [Dolphin] LoRA Prompt Weaver ๋ก๋ ์คํจ:\n{traceback.format_exc()}") | |
| # 20. Minimax Director (MiniMax/Hailuo์ฉ ํ๋กฌํํธ ๋๋ ํฐ. Wan์ฉ Prompt Director์ ๋ฌ๋ฆฌ | |
| # ํด๋ฆฝ ํ๋๊ฐ 6/10์ด๋ผ์, ๊ทธ ์์ ์ด ๋จ์ ๋นํธ๋ก ์ชผ๊ฐ๊ณ ๊ฐ ๊ตฌ๊ฐ์ ๋์ + MiniMax | |
| # ๊ณต์ ์นด๋ฉ๋ผ ๋ฌด๋ธ ํ๊ทธ๋ฅผ ๋ฐ์์ค๋ค.) | |
| try: | |
| from .dolphin_minimax_director import DolphinMinimaxDirector | |
| register_node("DolphinMinimaxDirector", DolphinMinimaxDirector, | |
| "๐ฌ๐ Dolphin Minimax Director (์ด ๋จ์ ํ์๋ผ์ธ โ Hailuo ํ๋กฌํํธ)") | |
| except Exception: | |
| print(f"\nโ [Dolphin] Minimax Director ๋ก๋ ์คํจ:\n{traceback.format_exc()}") | |
| # 21. Wan Refine H3 (MiniMax H3 ์ถ๋ ฅ โ Wan 2.2 LOW noise ์ -denoise ๋ฆฌํ์ธ ํจ์ค ์ฌ์ธ์). | |
| # H3(24fps / 17k+5 ํ๋ ์ ๊ทธ๋ฆฌ๋ / 768 short edge)์ Wan(16fps / 4n+1 / Wan2.1 VAE 16ch) | |
| # ์ฌ์ด์ ๋ฐฐ์ ํจ์ ์ ํ ๋ ธ๋์์ ์ฒ๋ฆฌ: 4n+1 ์ ๋ ฌ, VAE ์ค๋ฐฐ์ ์ฐจ๋จ, ์์ค ๋ผํ ํธ ์ธ์ฝ๋ฉ, | |
| # concat ์ปจ๋์ ๋ ์ฌ๊ตฌ์ฑ, sigma_shift ์ง์ ํจ์น, ์ ๋๋ฆฌํํธ ๋ณต์, ์ค๋์ค ๊ธธ์ด ์ ๋ ฌ. | |
| # ๊ฐ์ด ๋ฑ๋ก๋๋ Frame Grid ๋ ธ๋๋ ๋ ๊ทธ๋ฆฌ๋๊ฐ ๊ฒน์น๋ length(5/73/141/209/277/345โฆ)๋ฅผ ๊ณ์ฐํ๋ค. | |
| try: | |
| from .wan_h3_refine import WanH3Refine_Dolphin, WanH3FrameGrid_Dolphin | |
| register_node("WanH3Refine_Dolphin", WanH3Refine_Dolphin, | |
| "๐ฌ๐ Wan Refine H3 (low-denoise pass)") | |
| register_node("WanH3FrameGrid_Dolphin", WanH3FrameGrid_Dolphin, | |
| "๐ฌ๐ H3โWan Frame Grid") | |
| except Exception: | |
| print(f"\nโ [Dolphin] Wan Refine H3 ๋ก๋ ์คํจ:\n{traceback.format_exc()}") | |
| __all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS', 'WEB_DIRECTORY'] |