diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 00000000..5a815b65 Binary files /dev/null and b/.DS_Store differ diff --git a/.claude/agents/intent-consultant.md b/.claude/agents/intent-consultant.md new file mode 100644 index 00000000..158caafc --- /dev/null +++ b/.claude/agents/intent-consultant.md @@ -0,0 +1,194 @@ +--- +name: "intent-consultant" +description: "Use this agent when ambiguity exists about what the user wants before proceeding with a task, when a request could be interpreted multiple ways and the cost of guessing wrong is high, when a complex multi-step task requires clarifying the scope or constraints before execution, or when partial information has been provided and making assumptions could lead to significant rework.\\n\\n\\nContext: The user has given a vague instruction that could mean several different things.\\nuser: \"Clean up the node\"\\nassistant: \"This request is ambiguous — I'm going to use the intent-consultant agent to clarify what the user means before making changes.\"\\n\\nBefore touching any code, launch the intent-consultant agent to surface the most likely interpretations and confirm the correct one.\\n\\n\\n\\n\\nContext: The user asks for a feature that intersects multiple systems.\\nuser: \"Add a blending option to the sampler\"\\nassistant: \"There are several ways to implement blending here. Let me use the intent-consultant agent to reason through what the user most likely wants before writing any code.\"\\n\\nThe request is underspecified. Use the intent-consultant agent to analyze context, infer intent, and either ask a targeted clarifying question or proceed with a clearly stated assumption.\\n\\n" +model: haiku +color: green +memory: project +--- + +You are an expert intent analyst and communication strategist. Your sole purpose is to consult with the main model (yourself, reasoning carefully) to determine exactly what the user wants before any action is taken. You combine deep contextual reasoning, knowledge of common patterns in user requests, and disciplined Socratic questioning to eliminate ambiguity and surface true intent. + +## Core Responsibilities + +1. **Analyze the request**: Break down what was said literally, what is likely meant pragmatically, and what unstated constraints or goals may exist. +2. **Surface interpretations**: Enumerate all plausible readings of the request, ranked by likelihood given the available context. +3. **Identify the crux of ambiguity**: Pinpoint the single most important unknown. Do not ask multiple questions at once. +4. **Decide: Ask or Assume**: If one interpretation is clearly dominant (>80% confidence), state your assumption explicitly and proceed. If genuine ambiguity remains, ask one focused clarifying question. +5. **Provide a recommendation**: Always end with a concrete proposed course of action, even if a question is also being asked. + +## Decision Framework + +- **High confidence (proceed with assumption)**: The context, prior conversation, or domain norms make one interpretation obviously correct. State the assumption and move forward. +- **Medium confidence (ask one question)**: Two or more plausible interpretations exist with meaningfully different implementation paths. Ask the single question whose answer resolves the most uncertainty. +- **Low confidence (structured elicitation)**: The request is nearly opaque. Ask for the goal (not the method), using open-ended framing: "What outcome are you trying to achieve?" + +## Output Format + +Structure your response as: + +**Intent Analysis** +- Literal request: [what was literally said] +- Most likely intent: [your best interpretation] +- Alternative interpretations: [list others if relevant] +- Ambiguity crux: [the key unknown, if any] + +**Confidence**: [High / Medium / Low] + +**Recommended Action**: [What should be done next — either proceed with stated assumption, or ask the following question] + +> [If asking: one focused, specific question] + +## Behavioral Rules + +- Never ask more than one question at a time. +- Never proceed silently on an ambiguous request — always make your interpretation explicit. +- Prefer inferring from context over asking, when context is sufficient. +- Be concise. This is a consultation step, not the final deliverable. +- Do not implement anything — your job is intent clarification only. +- Consider project-specific context (established patterns, prior decisions, known constraints) when assessing likelihood of interpretations. + +**Update your agent memory** as you discover recurring patterns of ambiguity, common user intent shortcuts, domain-specific terminology the user uses, and preferences for how they like assumptions to be handled. This builds up institutional knowledge across conversations. + +Examples of what to record: +- Recurring request patterns and how the user typically means them +- Domain terms the user uses with non-obvious meanings +- User preference: prefers explicit assumptions vs. prefers to be asked +- Types of tasks where the user's scope is usually broader or narrower than stated + +# Persistent Agent Memory + +You have a persistent, file-based memory system at `/Users/dex/Documents/ComfyUI-FunPack/.claude/agent-memory/intent-consultant/`. This directory already exists — write to it directly with the Write tool (do not run mkdir or check for its existence). + +You should build up this memory system over time so that future conversations can have a complete picture of who the user is, how they'd like to collaborate with you, what behaviors to avoid or repeat, and the context behind the work the user gives you. + +If the user explicitly asks you to remember something, save it immediately as whichever type fits best. If they ask you to forget something, find and remove the relevant entry. + +## Types of memory + +There are several discrete types of memory that you can store in your memory system: + + + + user + Contain information about the user's role, goals, responsibilities, and knowledge. Great user memories help you tailor your future behavior to the user's preferences and perspective. Your goal in reading and writing these memories is to build up an understanding of who the user is and how you can be most helpful to them specifically. For example, you should collaborate with a senior software engineer differently than a student who is coding for the very first time. Keep in mind, that the aim here is to be helpful to the user. Avoid writing memories about the user that could be viewed as a negative judgement or that are not relevant to the work you're trying to accomplish together. + When you learn any details about the user's role, preferences, responsibilities, or knowledge + When your work should be informed by the user's profile or perspective. For example, if the user is asking you to explain a part of the code, you should answer that question in a way that is tailored to the specific details that they will find most valuable or that helps them build their mental model in relation to domain knowledge they already have. + + user: I'm a data scientist investigating what logging we have in place + assistant: [saves user memory: user is a data scientist, currently focused on observability/logging] + + user: I've been writing Go for ten years but this is my first time touching the React side of this repo + assistant: [saves user memory: deep Go expertise, new to React and this project's frontend — frame frontend explanations in terms of backend analogues] + + + + feedback + Guidance the user has given you about how to approach work — both what to avoid and what to keep doing. These are a very important type of memory to read and write as they allow you to remain coherent and responsive to the way you should approach work in the project. Record from failure AND success: if you only save corrections, you will avoid past mistakes but drift away from approaches the user has already validated, and may grow overly cautious. + Any time the user corrects your approach ("no not that", "don't", "stop doing X") OR confirms a non-obvious approach worked ("yes exactly", "perfect, keep doing that", accepting an unusual choice without pushback). Corrections are easy to notice; confirmations are quieter — watch for them. In both cases, save what is applicable to future conversations, especially if surprising or not obvious from the code. Include *why* so you can judge edge cases later. + Let these memories guide your behavior so that the user does not need to offer the same guidance twice. + Lead with the rule itself, then a **Why:** line (the reason the user gave — often a past incident or strong preference) and a **How to apply:** line (when/where this guidance kicks in). Knowing *why* lets you judge edge cases instead of blindly following the rule. + + user: don't mock the database in these tests — we got burned last quarter when mocked tests passed but the prod migration failed + assistant: [saves feedback memory: integration tests must hit a real database, not mocks. Reason: prior incident where mock/prod divergence masked a broken migration] + + user: stop summarizing what you just did at the end of every response, I can read the diff + assistant: [saves feedback memory: this user wants terse responses with no trailing summaries] + + user: yeah the single bundled PR was the right call here, splitting this one would've just been churn + assistant: [saves feedback memory: for refactors in this area, user prefers one bundled PR over many small ones. Confirmed after I chose this approach — a validated judgment call, not a correction] + + + + project + Information that you learn about ongoing work, goals, initiatives, bugs, or incidents within the project that is not otherwise derivable from the code or git history. Project memories help you understand the broader context and motivation behind the work the user is doing within this working directory. + When you learn who is doing what, why, or by when. These states change relatively quickly so try to keep your understanding of this up to date. Always convert relative dates in user messages to absolute dates when saving (e.g., "Thursday" → "2026-03-05"), so the memory remains interpretable after time passes. + Use these memories to more fully understand the details and nuance behind the user's request and make better informed suggestions. + Lead with the fact or decision, then a **Why:** line (the motivation — often a constraint, deadline, or stakeholder ask) and a **How to apply:** line (how this should shape your suggestions). Project memories decay fast, so the why helps future-you judge whether the memory is still load-bearing. + + user: we're freezing all non-critical merges after Thursday — mobile team is cutting a release branch + assistant: [saves project memory: merge freeze begins 2026-03-05 for mobile release cut. Flag any non-critical PR work scheduled after that date] + + user: the reason we're ripping out the old auth middleware is that legal flagged it for storing session tokens in a way that doesn't meet the new compliance requirements + assistant: [saves project memory: auth middleware rewrite is driven by legal/compliance requirements around session token storage, not tech-debt cleanup — scope decisions should favor compliance over ergonomics] + + + + reference + Stores pointers to where information can be found in external systems. These memories allow you to remember where to look to find up-to-date information outside of the project directory. + When you learn about resources in external systems and their purpose. For example, that bugs are tracked in a specific project in Linear or that feedback can be found in a specific Slack channel. + When the user references an external system or information that may be in an external system. + + user: check the Linear project "INGEST" if you want context on these tickets, that's where we track all pipeline bugs + assistant: [saves reference memory: pipeline bugs are tracked in Linear project "INGEST"] + + user: the Grafana board at grafana.internal/d/api-latency is what oncall watches — if you're touching request handling, that's the thing that'll page someone + assistant: [saves reference memory: grafana.internal/d/api-latency is the oncall latency dashboard — check it when editing request-path code] + + + + +## What NOT to save in memory + +- Code patterns, conventions, architecture, file paths, or project structure — these can be derived by reading the current project state. +- Git history, recent changes, or who-changed-what — `git log` / `git blame` are authoritative. +- Debugging solutions or fix recipes — the fix is in the code; the commit message has the context. +- Anything already documented in CLAUDE.md files. +- Ephemeral task details: in-progress work, temporary state, current conversation context. + +These exclusions apply even when the user explicitly asks you to save. If they ask you to save a PR list or activity summary, ask what was *surprising* or *non-obvious* about it — that is the part worth keeping. + +## How to save memories + +Saving a memory is a two-step process: + +**Step 1** — write the memory to its own file (e.g., `user_role.md`, `feedback_testing.md`) using this frontmatter format: + +```markdown +--- +name: {{short-kebab-case-slug}} +description: {{one-line summary — used to decide relevance in future conversations, so be specific}} +metadata: + type: {{user, feedback, project, reference}} +--- + +{{memory content — for feedback/project types, structure as: rule/fact, then **Why:** and **How to apply:** lines. Link related memories with [[their-name]].}} +``` + +In the body, link to related memories with `[[name]]`, where `name` is the other memory's `name:` slug. Link liberally — a `[[name]]` that doesn't match an existing memory yet is fine; it marks something worth writing later, not an error. + +**Step 2** — add a pointer to that file in `MEMORY.md`. `MEMORY.md` is an index, not a memory — each entry should be one line, under ~150 characters: `- [Title](file.md) — one-line hook`. It has no frontmatter. Never write memory content directly into `MEMORY.md`. + +- `MEMORY.md` is always loaded into your conversation context — lines after 200 will be truncated, so keep the index concise +- Keep the name, description, and type fields in memory files up-to-date with the content +- Organize memory semantically by topic, not chronologically +- Update or remove memories that turn out to be wrong or outdated +- Do not write duplicate memories. First check if there is an existing memory you can update before writing a new one. + +## When to access memories +- When memories seem relevant, or the user references prior-conversation work. +- You MUST access memory when the user explicitly asks you to check, recall, or remember. +- If the user says to *ignore* or *not use* memory: Do not apply remembered facts, cite, compare against, or mention memory content. +- Memory records can become stale over time. Use memory as context for what was true at a given point in time. Before answering the user or building assumptions based solely on information in memory records, verify that the memory is still correct and up-to-date by reading the current state of the files or resources. If a recalled memory conflicts with current information, trust what you observe now — and update or remove the stale memory rather than acting on it. + +## Before recommending from memory + +A memory that names a specific function, file, or flag is a claim that it existed *when the memory was written*. It may have been renamed, removed, or never merged. Before recommending it: + +- If the memory names a file path: check the file exists. +- If the memory names a function or flag: grep for it. +- If the user is about to act on your recommendation (not just asking about history), verify first. + +"The memory says X exists" is not the same as "X exists now." + +A memory that summarizes repo state (activity logs, architecture snapshots) is frozen in time. If the user asks about *recent* or *current* state, prefer `git log` or reading the code over recalling the snapshot. + +## Memory and other forms of persistence +Memory is one of several persistence mechanisms available to you as you assist the user in a given conversation. The distinction is often that memory can be recalled in future conversations and should not be used for persisting information that is only useful within the scope of the current conversation. +- When to use or update a plan instead of memory: If you are about to start a non-trivial implementation task and would like to reach alignment with the user on your approach you should use a Plan rather than saving this information to memory. Similarly, if you already have a plan within the conversation and you have changed your approach persist that change by updating the plan rather than saving a memory. +- When to use or update tasks instead of memory: When you need to break your work in current conversation into discrete steps or keep track of your progress use tasks instead of saving to memory. Tasks are great for persisting information about the work that needs to be done in the current conversation, but memory should be reserved for information that will be useful in future conversations. + +- Since this memory is project-scope and shared with your team via version control, tailor your memories to this project + +## MEMORY.md + +Your MEMORY.md is currently empty. When you save new memories, they will appear here. diff --git a/LTX2_Character_Consistency_Research.pdf b/LTX2_Character_Consistency_Research.pdf new file mode 100644 index 00000000..e5288ac3 --- /dev/null +++ b/LTX2_Character_Consistency_Research.pdf @@ -0,0 +1,200 @@ +%PDF-1.4 +%“Œ‹ž ReportLab Generated PDF document (opensource) +1 0 obj +<< +/F1 2 0 R /F2 3 0 R /F3 4 0 R /F4 5 0 R +>> +endobj +2 0 obj +<< +/BaseFont /Helvetica /Encoding /WinAnsiEncoding /Name /F1 /Subtype /Type1 /Type /Font +>> +endobj +3 0 obj +<< +/BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding /Name /F2 /Subtype /Type1 /Type /Font +>> +endobj +4 0 obj +<< +/BaseFont /Courier /Encoding /WinAnsiEncoding /Name /F3 /Subtype /Type1 /Type /Font +>> +endobj +5 0 obj +<< +/BaseFont /Symbol /Name /F4 /Subtype /Type1 /Type /Font +>> +endobj +6 0 obj +<< +/Contents 16 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 15 0 R /Resources << +/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +>> /Rotate 0 /Trans << + +>> + /Type /Page +>> +endobj +7 0 obj +<< +/Contents 17 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 15 0 R /Resources << +/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +>> /Rotate 0 /Trans << + +>> + /Type /Page +>> +endobj +8 0 obj +<< +/Contents 18 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 15 0 R /Resources << +/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +>> /Rotate 0 /Trans << + +>> + /Type /Page +>> +endobj +9 0 obj +<< +/Contents 19 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 15 0 R /Resources << +/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +>> /Rotate 0 /Trans << + +>> + /Type /Page +>> +endobj +10 0 obj +<< +/Contents 20 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 15 0 R /Resources << +/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +>> /Rotate 0 /Trans << + +>> + /Type /Page +>> +endobj +11 0 obj +<< +/Contents 21 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 15 0 R /Resources << +/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +>> /Rotate 0 /Trans << + +>> + /Type /Page +>> +endobj +12 0 obj +<< +/Contents 22 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 15 0 R /Resources << +/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +>> /Rotate 0 /Trans << + +>> + /Type /Page +>> +endobj +13 0 obj +<< +/PageMode /UseNone /Pages 15 0 R /Type /Catalog +>> +endobj +14 0 obj +<< +/Author (FunPack / digital-garbage) /CreationDate (D:20260526012645+03'00') /Creator (\(unspecified\)) /Keywords () /ModDate (D:20260526012645+03'00') /Producer (ReportLab PDF Library - \(opensource\)) + /Subject (\(unspecified\)) /Title (LTX-Video 2 Character Consistency - Research Findings) /Trapped /False +>> +endobj +15 0 obj +<< +/Count 7 /Kids [ 6 0 R 7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h]Rr\U.50bRGs,rTipHC[:d\lmN3Cd&EkNB]-b#d@Aap))D"]?N7rB&.0Qj6[/!rZqYSoQ%6G:fu1cS;mVf(R!)@d2"+$0E#%Bo6lOI/.TS;/M3&hs0h_rA;:r)KOD30D>N-,T?=QYXrk]6(jZY;6S">3+:#jV%L^qT7nb68A>>+76sj4he1Z.UDrgQUXP]~>endstream +endobj +xref +0 23 +0000000000 65535 f +0000000061 00000 n +0000000122 00000 n +0000000229 00000 n +0000000341 00000 n +0000000446 00000 n +0000000523 00000 n +0000000728 00000 n +0000000933 00000 n +0000001138 00000 n +0000001343 00000 n +0000001549 00000 n +0000001755 00000 n +0000001961 00000 n +0000002031 00000 n +0000002364 00000 n +0000002463 00000 n +0000005341 00000 n +0000007918 00000 n +0000010649 00000 n +0000013130 00000 n +0000015572 00000 n +0000018239 00000 n +trailer +<< +/ID +[] +% ReportLab generated PDF document -- digest (opensource) + +/Info 14 0 R +/Root 13 0 R +/Size 23 +>> +startxref +20908 +%%EOF diff --git a/__pycache__/__init__.cpython-312.pyc b/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 00000000..2c833ca7 Binary files /dev/null and b/__pycache__/__init__.cpython-312.pyc differ diff --git a/__pycache__/__init__.cpython-313.pyc b/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 00000000..612f1004 Binary files /dev/null and b/__pycache__/__init__.cpython-313.pyc differ diff --git a/__pycache__/__init__.cpython-314.pyc b/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 00000000..fe343c82 Binary files /dev/null and b/__pycache__/__init__.cpython-314.pyc differ diff --git a/__pycache__/conditioning.cpython-312.pyc b/__pycache__/conditioning.cpython-312.pyc new file mode 100644 index 00000000..58b61776 Binary files /dev/null and b/__pycache__/conditioning.cpython-312.pyc differ diff --git a/__pycache__/conditioning.cpython-313.pyc b/__pycache__/conditioning.cpython-313.pyc new file mode 100644 index 00000000..e86db5c1 Binary files /dev/null and b/__pycache__/conditioning.cpython-313.pyc differ diff --git a/__pycache__/conditioning.cpython-314.pyc b/__pycache__/conditioning.cpython-314.pyc new file mode 100644 index 00000000..9904d75a Binary files /dev/null and b/__pycache__/conditioning.cpython-314.pyc differ diff --git a/__pycache__/image_processing.cpython-312.pyc b/__pycache__/image_processing.cpython-312.pyc new file mode 100644 index 00000000..bf39360d Binary files /dev/null and b/__pycache__/image_processing.cpython-312.pyc differ diff --git a/__pycache__/image_processing.cpython-313.pyc b/__pycache__/image_processing.cpython-313.pyc new file mode 100644 index 00000000..98858fe0 Binary files /dev/null and b/__pycache__/image_processing.cpython-313.pyc differ diff --git a/__pycache__/ltx_enhancements.cpython-312.pyc b/__pycache__/ltx_enhancements.cpython-312.pyc new file mode 100644 index 00000000..67cba11c Binary files /dev/null and b/__pycache__/ltx_enhancements.cpython-312.pyc differ diff --git a/__pycache__/ltx_enhancements.cpython-313.pyc b/__pycache__/ltx_enhancements.cpython-313.pyc new file mode 100644 index 00000000..fdf578f1 Binary files /dev/null and b/__pycache__/ltx_enhancements.cpython-313.pyc differ diff --git a/__pycache__/ltx_enhancements.cpython-314.pyc b/__pycache__/ltx_enhancements.cpython-314.pyc new file mode 100644 index 00000000..96ecf80e Binary files /dev/null and b/__pycache__/ltx_enhancements.cpython-314.pyc differ diff --git a/__pycache__/model_management.cpython-312.pyc b/__pycache__/model_management.cpython-312.pyc new file mode 100644 index 00000000..966ccdae Binary files /dev/null and b/__pycache__/model_management.cpython-312.pyc differ diff --git a/__pycache__/model_management.cpython-313.pyc b/__pycache__/model_management.cpython-313.pyc new file mode 100644 index 00000000..b7eeca7c Binary files /dev/null and b/__pycache__/model_management.cpython-313.pyc differ diff --git a/__pycache__/samplers.cpython-312.pyc b/__pycache__/samplers.cpython-312.pyc new file mode 100644 index 00000000..c1d92ba8 Binary files /dev/null and b/__pycache__/samplers.cpython-312.pyc differ diff --git a/__pycache__/samplers.cpython-313.pyc b/__pycache__/samplers.cpython-313.pyc new file mode 100644 index 00000000..d2be36df Binary files /dev/null and b/__pycache__/samplers.cpython-313.pyc differ diff --git a/__pycache__/samplers.cpython-314.pyc b/__pycache__/samplers.cpython-314.pyc new file mode 100644 index 00000000..b171b7d7 Binary files /dev/null and b/__pycache__/samplers.cpython-314.pyc differ diff --git a/__pycache__/templates.cpython-312.pyc b/__pycache__/templates.cpython-312.pyc new file mode 100644 index 00000000..86168a58 Binary files /dev/null and b/__pycache__/templates.cpython-312.pyc differ diff --git a/__pycache__/templates.cpython-313.pyc b/__pycache__/templates.cpython-313.pyc new file mode 100644 index 00000000..aa1f506a Binary files /dev/null and b/__pycache__/templates.cpython-313.pyc differ diff --git a/__pycache__/templates.cpython-314.pyc b/__pycache__/templates.cpython-314.pyc new file mode 100644 index 00000000..fb89ebb6 Binary files /dev/null and b/__pycache__/templates.cpython-314.pyc differ diff --git a/__pycache__/value_function.cpython-312.pyc b/__pycache__/value_function.cpython-312.pyc new file mode 100644 index 00000000..7c9445fd Binary files /dev/null and b/__pycache__/value_function.cpython-312.pyc differ diff --git a/movie_editor/backend/bridge.py b/movie_editor/backend/bridge.py index e1816be7..9e052c5f 100644 --- a/movie_editor/backend/bridge.py +++ b/movie_editor/backend/bridge.py @@ -86,15 +86,61 @@ async def is_running(prompt_id: str) -> bool: _object_info_cache = {"data": None} +def _build_object_info_inprocess() -> Optional[dict]: + """Build the node registry directly from ComfyUI's NODE_CLASS_MAPPINGS — no HTTP, + no port guessing. Mirrors server.py's /object_info (the subset the editor reads). + Returns None if we're not running inside ComfyUI.""" + try: + import nodes as comfy_nodes # ComfyUI's global node registry + except Exception: + return None + import json + mappings = getattr(comfy_nodes, "NODE_CLASS_MAPPINGS", None) + if not mappings: + return None + disp = getattr(comfy_nodes, "NODE_DISPLAY_NAME_MAPPINGS", {}) or {} + out: dict[str, Any] = {} + for name, cls in mappings.items(): + try: + if hasattr(cls, "GET_NODE_INFO_V1"): # V3 internal nodes + info = cls.GET_NODE_INFO_V1() + else: + rt = list(getattr(cls, "RETURN_TYPES", ()) or ()) + info = { + "input": cls.INPUT_TYPES(), + "output": rt, + "output_name": list(getattr(cls, "RETURN_NAMES", rt) or rt), + "display_name": disp.get(name, name), + "category": getattr(cls, "CATEGORY", ""), + } + # normalize tuples -> lists (the HTTP path gets this for free via JSON); + # default=str drops any exotic, non-serializable widget defaults. + out[name] = json.loads(json.dumps(info, default=str)) + except Exception: + continue + return out or None + + async def object_info(refresh: bool = False) -> dict: """Full ComfyUI node registry (class -> input/output spec). Cached; combo lists - (installed files) refresh when `refresh=True` — same effect as pressing R in ComfyUI.""" + (installed files) refresh when `refresh=True` — same effect as pressing R in ComfyUI. + + Built in-process from NODE_CLASS_MAPPINGS (reliable, no port resolution). Falls + back to loopback HTTP only if the in-process registry isn't importable.""" if _object_info_cache["data"] is not None and not refresh: return _object_info_cache["data"] - async with await _session() as s: - async with s.get(_url("/object_info")) as r: - r.raise_for_status() - data = await r.json() + if refresh: + try: # force a filesystem rescan of model combos, like ComfyUI's R key + import folder_paths + folder_paths.filename_list_cache.clear() + except Exception: + pass + data = _build_object_info_inprocess() + if data is None: + async with await _session() as s: + async with s.get(_url("/object_info")) as r: + r.raise_for_status() + data = await r.json() _object_info_cache["data"] = data return data diff --git a/movie_editor/backend/builder.py b/movie_editor/backend/builder.py new file mode 100644 index 00000000..a1f9fec7 --- /dev/null +++ b/movie_editor/backend/builder.py @@ -0,0 +1,315 @@ +"""Build the API-format generation graph from code (no runtime template). + +The editor OWNS the fixed FunPack path; only the loader / image-processing / +empty-latent nodes are user-configured (Models menu -> models.json slots). This +module emits the fixed core in code, splices in the configured slot nodes, and +resolves their wiring: + + 1. fixed core — Studio -> LTXVConditioning -> Chain Sampler -> Separate AV -> + Audio VAE Decode -> Normalize -> VHS Combine, plus Concat AV, SaveRefinement, + RefinementKeyLoader and the fps/frames primitives. Internal links + widget + values are derived from the reference workflow (backend/reference/...). + 2. slot nodes — one per models.json slot, widget values from the slot config. + 3. wiring — explicit "Wire to" links first (slot output -> core port or + another slot input), then AUTO-WIRE by type: any still-unbound typed input is + filled from the unique producer of that type. Ambiguous / unsatisfied inputs + are reported, not guessed. + +Output is a ComfyUI /prompt graph: {node_id: {class_type, inputs}}. +""" +from __future__ import annotations + +import json +from typing import Any, Optional + +from . import config +from .nodes import WIDGET_PRIMITIVES, connection_inputs, node_outputs + +# ── fixed core ──────────────────────────────────────────────────────────────── +# logical id -> class_type +CORE: dict[str, str] = { + "studio": "FunPackStudio", + "cond": "LTXVConditioning", + "sampler": "FunPackLTXAVSceneChainSampler", + "concat": "LTXVConcatAVLatent", + "separate": "LTXVSeparateAVLatent", + "audiodec": "LTXVAudioVAEDecode", + "normaudio": "NormalizeAudioLoudness", + "vhs": "VHS_VideoCombine", + "saveref": "FunPackSaveRefinementLatent", + "keyloader": "FunPackRefinementKeyLoader", + "pos": "PrimitiveStringMultiline", + "neg": "PrimitiveStringMultiline", + "frames": "PrimitiveInt", + "fps": "PrimitiveFloat", + "f2i": "LTXFloatToInt", +} + +# reference-workflow node id per core node (to seed widget values from the user's +# real settings). Missing -> bare object_info / param defaults. +REF_ID: dict[str, int] = { + "studio": 5299, "cond": 5147, "sampler": 5333, "concat": 4528, "separate": 4845, + "audiodec": 5021, "normaudio": 5314, "vhs": 5019, "saveref": 5328, "keyloader": 5303, + "pos": 5012, "neg": 5256, "frames": 4988, "fps": 4989, "f2i": 5145, +} + +# core internal links: core_id -> {input_name: (src_core_id, output_index)} +CORE_LINKS: dict[str, dict[str, tuple[str, int]]] = { + "studio": {"positive_prompt": ("pos", 0), "negative_prompt": ("neg", 0), + "refinement_key_input": ("keyloader", 0)}, + "cond": {"positive": ("studio", 1), "negative": ("studio", 2), "frame_rate": ("fps", 0)}, + "sampler": {"model": ("studio", 0), "positive": ("cond", 0), "negative": ("cond", 1), + "sampler": ("studio", 4), "sigmas": ("studio", 5), + "latent_template": ("concat", 0), "refinement_key_input": ("keyloader", 0), + "num_frames_per_scene": ("frames", 0)}, + "concat": {"video_latent": ("studio", 12)}, + "separate": {"av_latent": ("sampler", 0)}, + "audiodec": {"samples": ("separate", 1)}, + "normaudio": {"audio": ("audiodec", 0)}, + "vhs": {"images": ("sampler", 1), "audio": ("normaudio", 0), "frame_rate": ("fps", 0)}, + "saveref": {"latent": ("separate", 0), "refinement_key": ("keyloader", 0)}, + "f2i": {"a": ("fps", 0)}, +} + +# core inputs that MUST be fed by a user slot (the old group-node outputs). +OPEN_PORTS: list[tuple[str, str, str]] = [ # (core_id, input, type) + ("studio", "model", "MODEL"), + ("studio", "clip", "CLIP"), + ("studio", "source_image", "IMAGE"), + ("studio", "latent", "LATENT"), + ("sampler", "vae", "VAE"), + ("concat", "audio_latent", "LATENT"), + ("audiodec", "audio_vae", "VAE"), +] + +# core outputs offered as auto-wire producers for slot inputs (image-proc etc.). +CORE_PRODUCERS: list[tuple[str, int, str]] = [ # (core_id, output_index, type) + ("frames", 0, "INT"), + ("fps", 0, "FLOAT"), + ("f2i", 0, "INT"), +] + +CONTROL_VALUES = {"fixed", "randomize", "increment", "decrement"} +_VHS_NON_INPUT = {"videopreview"} + + +class BuildError(RuntimeError): + pass + + +# ── widget extraction (UI widgets_values -> named inputs) ───────────────────── + +def _ordered_widget_names(node_def: dict) -> list[str]: + names = [] + inp = node_def.get("input") or {} + for group in ("required", "optional"): + for name, spec in (inp.get(group) or {}).items(): + if not isinstance(spec, (list, tuple)) or not spec: + continue + t = spec[0] + opts = spec[1] if len(spec) > 1 and isinstance(spec[1], dict) else {} + if opts.get("forceInput"): + continue # forceInput STRING is a socket, never a widget value + if isinstance(t, list) or t in WIDGET_PRIMITIVES: + names.append(name) + return names + + +def extract_widgets(node_def: Optional[dict], widgets_values: Any) -> dict: + """Map a UI node's widgets_values onto named inputs using INPUT_TYPES order. + + Handles the control_after_generate companion value that follows numeric + widgets (seed/value), and VHS-style dict widget stores. + """ + if isinstance(widgets_values, dict): + return {k: v for k, v in widgets_values.items() if k not in _VHS_NON_INPUT} + if not isinstance(widgets_values, list) or not node_def: + return {} + names = _ordered_widget_names(node_def) + out: dict[str, Any] = {} + vi = 0 + for nm in names: + if vi >= len(widgets_values): + break + val = widgets_values[vi]; vi += 1 + out[nm] = val + if (vi < len(widgets_values) and isinstance(val, (int, float)) + and isinstance(widgets_values[vi], str) and widgets_values[vi] in CONTROL_VALUES): + vi += 1 # skip control_after_generate + return out + + +def _widget_defaults(node_def: Optional[dict]) -> dict: + out = {} + if not node_def: + return out + inp = node_def.get("input") or {} + for group in ("required", "optional"): + for name, spec in (inp.get(group) or {}).items(): + if not isinstance(spec, (list, tuple)) or not spec: + continue + t = spec[0] + opts = spec[1] if len(spec) > 1 and isinstance(spec[1], dict) else {} + if opts.get("forceInput"): + continue + if isinstance(t, list): + out[name] = opts.get("default", t[0] if t else None) + elif t in WIDGET_PRIMITIVES: + if "default" in opts: + out[name] = opts["default"] + return out + + +# ── reference workflow ──────────────────────────────────────────────────────── + +def load_reference() -> dict: + try: + return json.loads((config.REFERENCE_DIR / "montage.workflow.json").read_text()) + except Exception: + return {} + + +def _ref_widgets(ref: dict) -> dict[int, Any]: + return {n.get("id"): n.get("widgets_values") for n in (ref.get("nodes") or [])} + + +# ── graph assembly ──────────────────────────────────────────────────────────── + +def _output_index(node_def: Optional[dict], out_name: str) -> int: + for i, o in enumerate(node_outputs(node_def or {})): + if o["name"] == out_name: + return i + return 0 + + +def build(object_info: dict, models_config: dict, params: dict) -> tuple[dict, dict]: + """Return (graph, report). `params`: prompt, negative_prompt, seed, + num_frames_per_scene, frame_rate. `models_config`: {"slots": [...]}.""" + object_info = object_info or {} + ref_wv = _ref_widgets(load_reference()) + graph: dict[str, dict] = {} + report: dict[str, list] = {"wired": [], "auto_wired": [], "ambiguous": [], "unsatisfied": []} + + missing = [c for c in CORE if c not in ("",) and CORE[c] not in object_info] + if missing: + report["unsatisfied"].append( + "Missing core node classes in ComfyUI: " + ", ".join(sorted(CORE[c] for c in missing))) + + # 1. core nodes: widget defaults <- reference values <- core links. + for cid, cls in CORE.items(): + nd = object_info.get(cls) + inputs = _widget_defaults(nd) + inputs.update(extract_widgets(nd, ref_wv.get(REF_ID.get(cid)))) + for inp, (src, idx) in CORE_LINKS.get(cid, {}).items(): + inputs[inp] = [src, idx] + graph[cid] = {"class_type": cls, "inputs": inputs} + + # 2. param overrides on the primitives + sampler seed. + graph["pos"]["inputs"]["value"] = params.get("prompt", "") + if params.get("negative_prompt") is not None: + graph["neg"]["inputs"]["value"] = params["negative_prompt"] + if params.get("num_frames_per_scene") is not None: + graph["frames"]["inputs"]["value"] = params["num_frames_per_scene"] + if params.get("frame_rate") is not None: + graph["fps"]["inputs"]["value"] = params["frame_rate"] + if params.get("seed") is not None: + graph["sampler"]["inputs"]["seed"] = params["seed"] + # the result must be written to the output dir so the editor can fetch it back + # (the reference graph used preview-only save_output=False). + graph["vhs"]["inputs"]["save_output"] = True + + # 3. slot nodes. + slots = (models_config or {}).get("slots") or [] + slot_node_id = {} + slot_def = {} + for s in slots: + sid = "slot_" + str(s.get("id")) + cls = s.get("node_class") + nd = object_info.get(cls) + slot_node_id[s["id"]] = sid + slot_def[s["id"]] = nd + inputs = _widget_defaults(nd) + inputs.update(s.get("inputs") or {}) + graph[sid] = {"class_type": cls, "inputs": inputs} + if cls not in object_info: + report["unsatisfied"].append(f"Slot node '{cls}' is not installed in ComfyUI.") + + # 4. explicit wires (slot OUTPUT -> port: | node::). + port_to_core = _port_index(object_info) + for s in slots: + sid = slot_node_id[s["id"]] + nd = slot_def[s["id"]] + for out_name, target in (s.get("wires") or {}).items(): + if not target: + continue + oidx = _output_index(nd, out_name) + dst = _resolve_target(target, port_to_core, slot_node_id) + if not dst: + report["unsatisfied"].append(f"{s.get('node_class')}.{out_name}: wire target '{target}' could not be resolved.") + continue + dnode, dinput = dst + graph[dnode]["inputs"][dinput] = [sid, oidx] + report["wired"].append(f"{s.get('node_class')}.{out_name} -> {dnode}.{dinput}") + + # 5. auto-wire remaining unbound typed inputs by unique producer. + producers = _producers(graph, slots, slot_node_id, slot_def, object_info) + _autowire(graph, slots, slot_node_id, slot_def, object_info, producers, report) + + return graph, report + + +def _port_index(object_info: dict) -> dict[str, tuple[str, str]]: + """Map pipeline-port id ('Class.input' / 'FunPackStudio.input') -> (core_id, input).""" + cls_to_core = {v: k for k, v in CORE.items()} + idx: dict[str, tuple[str, str]] = {} + for cid, cls in CORE.items(): + nd = object_info.get(cls) + for ci in connection_inputs(nd or {}): + idx[f"{cls}.{ci['name']}"] = (cid, ci["name"]) + # FunPack ports use the class name directly too (already covered above). + return idx + + +def _resolve_target(target: str, port_to_core, slot_node_id) -> Optional[tuple[str, str]]: + if target.startswith("port:"): + return port_to_core.get(target[5:]) + if target.startswith("node:"): + _, sid, inp = target.split(":", 2) + node = slot_node_id.get(sid) + return (node, inp) if node else None + return None + + +def _producers(graph, slots, slot_node_id, slot_def, object_info): + """type -> list of (node_id, output_index). Slots + core producers.""" + out: dict[str, list] = {} + for cid, oidx, t in CORE_PRODUCERS: + out.setdefault(t, []).append((cid, oidx)) + for s in slots: + nd = slot_def[s["id"]] + for i, o in enumerate(node_outputs(nd or {})): + out.setdefault(o["type"], []).append((slot_node_id[s["id"]], i)) + return out + + +def _autowire(graph, slots, slot_node_id, slot_def, object_info, producers, report): + targets = [(cid, inp, t) for cid, inp, t in OPEN_PORTS] + for s in slots: # slot connection inputs (e.g. image-proc vae/image/length) + nd = slot_def[s["id"]] + for ci in connection_inputs(nd or {}): + targets.append((slot_node_id[s["id"]], ci["name"], ci["type"])) + + for node_id, inp, t in targets: + node = graph.get(node_id) + if not node: + continue + if isinstance(node["inputs"].get(inp), list): + continue # already wired (explicit/core) + cands = [p for p in producers.get(t, []) if p[0] != node_id] + if len(cands) == 1: + node["inputs"][inp] = [cands[0][0], cands[0][1]] + report["auto_wired"].append(f"{node_id}.{inp} <- {cands[0][0]} ({t})") + elif len(cands) > 1: + report["ambiguous"].append(f"{node_id}.{inp} ({t}): {len(cands)} possible sources — wire it explicitly.") + else: + report["unsatisfied"].append(f"{node_id}.{inp} ({t}): no source available.") diff --git a/movie_editor/backend/config.py b/movie_editor/backend/config.py index 4de982c0..b9d48d06 100644 --- a/movie_editor/backend/config.py +++ b/movie_editor/backend/config.py @@ -18,6 +18,9 @@ TEMPLATE_PATH = Path( os.environ.get("FUNPACK_MOVIE_TEMPLATE", BACKEND_DIR / "templates" / "ltxav_chain.api.json") ) FRONTEND_DIR = BACKEND_DIR.parent / "frontend" +# Saved copy of the user's real workflow — read only, to seed fixed-core widget +# values (the editor builds the graph in code; this is not a runtime template). +REFERENCE_DIR = BACKEND_DIR / "reference" def comfy_base_url() -> str: diff --git a/movie_editor/backend/workflow.py b/movie_editor/backend/workflow.py deleted file mode 100644 index 83cb34a8..00000000 --- a/movie_editor/backend/workflow.py +++ /dev/null @@ -1,142 +0,0 @@ -"""Load the user's API-format workflow and inject per-run parameters. - -The exact graph (node ids/classes) is the user's — exported via ComfyUI -"Save (API Format)" to config.TEMPLATE_PATH (workflow-first: we don't fabricate -wiring). This module is graph-agnostic: it binds logical params to nodes by -class_type or explicit node id, and writes their widget inputs. - -API format: { "": {"class_type": str, "inputs": {...}, ...}, ... } - -Bindings can be overridden by a JSON file next to the template -(`