bjooo commited on
Commit
4fee53b
ยท
verified ยท
1 Parent(s): 6c68f8d

Delete dolphin_director.py

Browse files
Files changed (1) hide show
  1. 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}