Delete dolphin_director.py
Browse files- dolphin_director.py +0 -93
dolphin_director.py
DELETED
|
@@ -1,93 +0,0 @@
|
|
| 1 |
-
import os
|
| 2 |
-
import re
|
| 3 |
-
import json
|
| 4 |
-
import hashlib
|
| 5 |
-
import urllib.request
|
| 6 |
-
import urllib.error
|
| 7 |
-
|
| 8 |
-
import folder_paths
|
| 9 |
-
import comfy.sd
|
| 10 |
-
import comfy.lora
|
| 11 |
-
import comfy.utils
|
| 12 |
-
from safetensors import safe_open
|
| 13 |
-
|
| 14 |
-
try:
|
| 15 |
-
from .promp_logic_v32_story import MODEL_PRESETS, MODEL_PRESET_LABELS, resolve_model
|
| 16 |
-
except Exception:
|
| 17 |
-
MODEL_PRESETS = {"๐ DeepSeek V3.2": "deepseek/deepseek-v3.2"}
|
| 18 |
-
MODEL_PRESET_LABELS = list(MODEL_PRESETS.keys())
|
| 19 |
-
def resolve_model(p, c): return c if p == "custom" else "deepseek/deepseek-v3.2"
|
| 20 |
-
|
| 21 |
-
class DolphinCinematicDirector:
|
| 22 |
-
@classmethod
|
| 23 |
-
def INPUT_TYPES(s):
|
| 24 |
-
loras = ["None"] + folder_paths.get_filename_list("loras")
|
| 25 |
-
return {
|
| 26 |
-
"required": {
|
| 27 |
-
"model_base": ("MODEL",), "model_high": ("MODEL",), "model_low": ("MODEL",),
|
| 28 |
-
"mode": (["๐ค Auto LLM (Story Splitter)", "โ๏ธ Manual"], {"default": "๐ค Auto LLM (Story Splitter)"}),
|
| 29 |
-
"master_story": ("STRING", {"multiline": True}),
|
| 30 |
-
"tagger_context": ("STRING", {"multiline": True}),
|
| 31 |
-
"openrouter_api_key": ("STRING", {"default": ""}),
|
| 32 |
-
},
|
| 33 |
-
"optional": {
|
| 34 |
-
"external_triggers": ("STRING", {"forceInput": True}),
|
| 35 |
-
}
|
| 36 |
-
}
|
| 37 |
-
|
| 38 |
-
RETURN_TYPES = ("MODEL", "MODEL", "MODEL", "STRING") * 4 + ("STRING",)
|
| 39 |
-
RETURN_NAMES = tuple([f"c{i}_{n}" for i in range(1, 5) for n in ["base", "high", "low", "prompt"]] + ["debug_info"])
|
| 40 |
-
FUNCTION = "direct"
|
| 41 |
-
CATEGORY = "Dolphin"
|
| 42 |
-
|
| 43 |
-
def _build_final(self, action, tags, master_scene, name, trigger_str):
|
| 44 |
-
# 1. ํธ๋ฆฌ๊ฑฐ ์๋(trigger_str)์ ์บ๋ฆญํฐ ์ด๋ฆ(name)๋ง ์๋จ์ ๋ฐฐ์น
|
| 45 |
-
header = []
|
| 46 |
-
if name: header.append(name)
|
| 47 |
-
if trigger_str: header.append(trigger_str)
|
| 48 |
-
|
| 49 |
-
# 2. ๋์(action)๊ณผ ๋ฐฐ๊ฒฝ(master_scene)๋ง ํ๋จ์ ๋ฐฐ์น
|
| 50 |
-
# ๐ ํต์ฌ: ์ฌ๊ธฐ์ 'tags' ๋ณ์๋ฅผ ์์ ์ฌ์ฉํ์ง ์์์ผ๋ก์จ ๋ฌ์ฌ ํฌํจ์ ์์ฒ ์ฐจ๋จ
|
| 51 |
-
body = []
|
| 52 |
-
if master_scene and master_scene.strip():
|
| 53 |
-
body.append(master_scene.strip())
|
| 54 |
-
if action and action.strip():
|
| 55 |
-
body.append(action.strip())
|
| 56 |
-
|
| 57 |
-
# ๊ฒฐ๊ณผ๊ฐ ๊ฒฐํฉ
|
| 58 |
-
header_str = ", ".join(header)
|
| 59 |
-
body_str = " ".join(body)
|
| 60 |
-
|
| 61 |
-
if header_str and body_str:
|
| 62 |
-
return f"{header_str}\n{body_str}"
|
| 63 |
-
return header_str or body_str
|
| 64 |
-
|
| 65 |
-
def _llm_split(self, story, name, tags, key, model):
|
| 66 |
-
# ๐ ์์ : LLM์๊ฒ๋ ๋ฌ์ฌ๋ฅผ ๋ณด๋ด๋, ์ถ๋ ฅ JSON์์๋ ๋์๋ง ๋ฝ๋๋ก ๊ฐ์
|
| 67 |
-
sys_p = (
|
| 68 |
-
"You are an action-only generator. "
|
| 69 |
-
"DO NOT output any visual descriptions, clothing, lighting, or setting details. "
|
| 70 |
-
"Your output must ONLY be the physical movement of the character. "
|
| 71 |
-
"If you include any adjective-heavy descriptions, you will be penalized. "
|
| 72 |
-
"Strictly output only the kinetic action in the JSON fields."
|
| 73 |
-
)
|
| 74 |
-
|
| 75 |
-
def direct(self, model_base, model_high, model_low, mode, master_story, tagger_context, openrouter_api_key, external_triggers="", **kw):
|
| 76 |
-
# ๐ ๊ฐ๋ ฅํ ๋ฐฉ์ด: ์ด๋ค ๋ฌ์ฌ๊ฐ ๋ค์ด์๋ ํ๊ทธ๋ ๊ฐ์ ๋ก ๋น ๊ฐ์ผ๋ก ๋์ฒด
|
| 77 |
-
tagger_context = ""
|
| 78 |
-
|
| 79 |
-
# ์ดํ ๋ก์ง...
|
| 80 |
-
# ๋ชจ๋๋ณ ์ฒ๋ฆฌ
|
| 81 |
-
clips = [master_story] * 4 # ๋จ์ํ ๋ก์ง
|
| 82 |
-
master_scene = "action"
|
| 83 |
-
final_name = "character"
|
| 84 |
-
|
| 85 |
-
outs = []
|
| 86 |
-
for c in range(1, 5):
|
| 87 |
-
# ๐ ๊ฐ์ ๋ก tags(tagger_context)๋ฅผ ๋น ๋ฌธ์์ด("")๋ก ์ ๋ฌํ์ฌ ๋ฌด๋ ฅํ
|
| 88 |
-
prompt = self._build_final(clips[c-1], "", master_scene, final_name, external_triggers)
|
| 89 |
-
outs.extend([model_base, model_high, model_low, prompt])
|
| 90 |
-
|
| 91 |
-
return tuple(outs) + ("Success",)
|
| 92 |
-
|
| 93 |
-
NODE_CLASS_MAPPINGS = {"DolphinCinematicDirector": DolphinCinematicDirector}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|