55 Commits
Author SHA1 Message Date
digital-garbageandClaude Sonnet 4.6 9dbd239702 Add visual transition effects to scene chain sampler
Custom transition triggers in Studio can now have a visual_effect assigned
(fade_to_black, crossfade, blur_out_in). When triggered during scene splitting,
the effect fires at that scene boundary: the sampler decodes the latent window
around the boundary, applies the pixel-space effect, and re-encodes in-place.

No new nodes needed — VAE is already connected to the scene chain sampler.
New transition_duration input controls how many pixel frames are affected.
New scene_boundaries output provides the boundary list for debugging.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 17:50:31 +03:00
digital-garbageandClaude Sonnet 4.6 f6c761746f Add Reference injection toggle to Studio, off by default
The i2v hidden state injection only produces meaningful results alongside
carry_i2v_guides in the Scene Chain Sampler. Without it the injection
has no reliable reference to anchor from (proven through testing).

New Studio Refiner setting: "Reference injection" toggle (default off).
Hint explains it should be enabled together with carry_i2v_guides.
Passing reference_latent=None to build_enhancements when disabled so
the entire injection path is skipped cleanly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 22:59:42 +03:00
digital-garbageandClaude Sonnet 4.6 223e60e832 Add silent transition placement - split without outputting the trigger
New placement option 'silent': the transition phrase marks the scene
boundary but is stripped from the output entirely. Neither the previous
nor the next segment contains it. Available globally and as a per-entry
override on custom transitions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 19:38:29 +03:00
digital-garbageandClaude Sonnet 4.6 5e1aa4a6c3 Add transition placement control (start/end of segment)
- Global setting in Studio Refiner tab: "Transition placement" (start/end).
  start = transition opens the new segment (existing default behavior).
  end = transition closes the previous segment instead.
- Per-entry placement override in Transitions tab (global/start/end).
  Custom transitions can pin their placement regardless of the global setting.
- transition items gain a placement field (global/start/end, defaults to global).
- load_custom_transition_triggers returns {trigger_lower: placement|None} so
  the split function can do per-trigger lookups efficiently.
- refine_v2 and Studio.run() wired with split_transition_placement parameter.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 19:10:13 +03:00
digital-garbageandClaude Sonnet 4.6 acdc4c41d6 Collapsible shortcut/transition rows, optional replacement, name fallback
- Shortcuts and Transitions: saved entries collapse to a summary row (name +
  on/off badge); click to expand, Collapse button to close without saving
- Transition summary also shows trigger phrase in italic next to the name
- Shortcuts: replacement is no longer required; blank/missing defaults to [""]
  which removes the matched phrase (same as explicit empty replacement)
- Shortcuts: name falls back to first activation word when left blank
- New summary row CSS: badge-on/badge-off, label, trigger styles

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 18:16:59 +03:00
digital-garbageandClaude Sonnet 4.6 889e4dc2c8 Add shortcuts empty replacement, custom transitions, and longer-phrase-wins tests
- Shortcuts: allow empty string as a valid replacement to remove matched phrases
  from prompts; post-pass cleans up orphaned commas/spaces left by removals
- Shortcuts: add cross-shortcut longer-phrase-wins test confirming ordered
  alternation handles multiple shortcuts with overlapping triggers correctly
- Transitions: new user-editable transition word list stored in transitions.json;
  custom triggers extend the built-in split pattern at runtime, keyed by name
- Transitions: Studio JS gets a dedicated Transitions tab (name, trigger, enabled)
  with Add/Refresh/Import/Export toolbar
- Transitions: four API routes mirroring shortcuts (GET, export, save/delete, import)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 17:47:55 +03:00
digital-garbage 3434d1efa2 Add global scene shortcuts 2026-05-22 16:38:33 +03:00
digital-garbage 87db442476 Fix order-only scene splitting 2026-05-21 00:14:45 +03:00
digital-garbage 9352c5f556 Add LTXAV scene chain sampler 2026-05-20 19:51:06 +03:00
digital-garbage e8f0b0f83f Remove standalone scene transition nodes 2026-05-20 19:29:33 +03:00
digital-garbageandClaude Sonnet 4.6 56f0f30b7a Remove transition_contrast - no longer needed
With split_by_transitions outputting a single conditioning, the contrastive
conditioning math has nothing to act on. Removed from Refiner V2 inputs,
refine_v2 signature, Studio JSON settings, Studio popup UI.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 18:52:43 +03:00
digital-garbageandClaude Sonnet 4.6 a8cda301c9 Add contrastive scene conditioning to sharpen transition cuts
For each context window, apply:
  window_i = general + contrast × (scene_i − general)

where general = the full-prompt conditioning (refined, with memory
applied). The character description cancels in the delta because it
appears in both scene_i and general; the push focuses on what is
unique to each scene (action, environment).

- contrast=1.0 → plain scene encoding (original behaviour)
- contrast=1.5 → default, 50% extra push toward scene content
- contrast=2.0 → classic contrastive (2×scene − general)

New parameter: transition_contrast (FLOAT, default 1.5, range 1.0-4.0)
on Refiner V2 and in Studio popup Refiner tab.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 16:14:24 +03:00
digital-garbageandClaude Sonnet 4.6 012b2ca3c2 Fix context windows dim detection and Studio toggle
Context Transition Windows: auto-detect temporal dim by scanning
x_in's axes for a size that's > overlap and <= 4096. Search order:
dim 2 (standard [B,C,T,H,W]), dim 1, dim 0 (LTXAV packs frames at 0),
then remaining dims. Skip windowing entirely when no suitable dim is
found (packed formats where no axis maps to frame count).

Studio JS: fix 'Split by transitions' toggle showing 'undefined' -
was appending splitToggle.container which doesn't exist; corrected
to splitToggle.wrap (the actual property returned by toggleEl).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 15:28:36 +03:00
digital-garbageandClaude Sonnet 4.6 afa5ad2ea9 Context Transition Windows: strip to MODEL in/out, only total_frames
All configuration is now auto-computed at sampling time - no user-facing
settings except the optional total_frames INT. Window count is derived
from the number of conditioning entries Refiner/Studio outputs. Window
size is total_frames (or actual latent size) / num_windows. Boundaries
are placed at equal intervals. split_conds_to_windows always on.

Studio: move split_by_transitions from direct node input to the Refiner
tab in the popup editor. Removed direct input, added toggle + hint text.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 15:20:24 +03:00
digital-garbageandClaude Sonnet 4.6 e24459b501 Remove 'concept' LoRA type - it was an undifferentiated alias for action
Removed from LORA_BLOCK_TYPE_PROFILES, LORA_TYPE_BLOCK_ZONES,
LORA_REFINER_TYPE_PROFILES, ACTION_LORA_TYPES, the validation
special-case, and the Studio JS LORA_TYPES dropdown.

normalize_lora_type() keeps the concept->action mapping for silent
backwards compatibility with any existing saved stacks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 20:01:53 +03:00
digital-garbageandClaude Sonnet 4.6 2790dbb8e7 LTX enhancements: attention temperature, temporal RoPE, anchor transfer
Add ltx_enhancements.py with four automatic generation improvements
driven by the refiner rating system:

Technique 2 - Per-block attention temperature: sharper (colder) attention
on semantic anchor blocks 14/19 when quality/concept is missing; softer
on early blocks when details are missing. Capped at 0.72-1.22x range.

Technique 3 - Temporal RoPE style: frame_rate manipulation via
model_function_wrapper. Selector exposed in FunPackVideoRefinerV2 node
(optional input) and in Studio popup Refiner tab.
  natural=no change, accelerate=+35% fps, decelerate=-28% fps,
  loop/freeze=experimental coordinate tricks.

Technique 4 - Denoise creativity mask: spatial noise weighting derived
from latent variance; high-variance regions get more denoising freedom
scaled by reward. Built but applied by downstream latent consumers.

Technique 5 - Attention anchor transfer: hidden states at anchor blocks
14 and 19 are captured via patches_replace["dit"] on every run and saved
to refinements/attn_maps/temp_{key}.pt. When the user rates a run
Perfect, bless_attention_maps() promotes the temp file to a blessed file.
Subsequent runs inject the blessed maps at 5-28% strength scaled by
reward, transferring semantic structure from good outputs onto new runs.

All enhancements are composable with existing attn2 direction patches
and STG/PAG blocks via patches_replace composition.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 19:38:36 +03:00
DigitalGarbage f6d91dfb20 Fix the advisor tab 2026-05-18 18:09:04 +03:00
digital-garbageandClaude Sonnet 4.6 cb4a4a8767 FunPackStudio: auto-save all field changes to widget with 600ms debounce
Event delegation on the panel root catches every input/change event
from any field inside the popup and schedules a debounced save to the
studio_settings and adjustments widgets. Changes survive page refresh
without needing to click Close.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 19:55:41 +03:00
digital-garbageandClaude Sonnet 4.6 0dfe96064d FunPackStudio: persist active tab across page refreshes via localStorage
Stores the last active tab per node ID. Survives page refresh.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 19:53:26 +03:00
digital-garbageandClaude Sonnet 4.6 53555bd495 FunPackStudio: clear sampler body before re-render on type change
renderSampler() now clears the body before rebuilding so changing the
sampler type replaces the settings instead of appending to them.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 19:50:08 +03:00
digital-garbageandClaude Sonnet 4.6 8390a17baf FunPackStudio: add sampler outputs and Sampler popup tab
Two new output pairs between seed and loss_graph:
- high_pass_sampler (SAMPLER) + high_pass_sigmas (SIGMAS)
- low_pass_sampler (SAMPLER) + low_pass_sigmas (SIGMAS)

Sampler tab in popup: per-pass selection of Hybrid Euler 2S, Distilled
Flow, or KSampler (standard ComfyUI fallback). Each type shows its own
settings fields. Motion pulse and velocity bias sections collapse when
mode is "off". Sigmas entered as comma-separated floats; empty means
rely on external sigmas input.

Python: _build_one_sampler() and _build_samplers() class methods handle
the instantiation and sigma parsing. Each sampler is built from the
same get_sampler() call as the standalone node.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 19:41:58 +03:00
digital-garbageandClaude Sonnet 4.6 76c8693fe8 FunPackStudio: show Scene Builder banner in Refiner tab when active
When Scene Builder mode is not Pass-through, the Refiner tab shows a
blue banner explaining the positive prompt is built in the Scene tab
with a clickable link that switches to it. The intent override field is
grayed out and disabled since intent derives from the scene prompt.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 19:33:36 +03:00
digital-garbageandClaude Sonnet 4.6 afe703ad56 FunPackStudio: encode negative prompt internally via CLIP
Add negative_prompt STRING input. Priority chain for negative output:
1. negative_conditioning (pre-encoded CONDITIONING) - pass through as-is
2. negative_prompt (text) encoded via CLIP - removes need for external CLIPTextEncode
3. Popup default negative_prompt field in Refiner tab
4. Empty list if nothing is provided

Negative prompt field added to Refiner tab in popup with override toggle.
Override system extended with negative_prompt key.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 19:25:43 +03:00
digital-garbageandClaude Sonnet 4.6 b6edaf6db6 FunPackStudio: integrate full LoRA chain internally, remove lora_stack output
LoRA pipeline is now fully internal to Studio:
1. FunPackApplyLoraWeights reads session weight suggestions for the
   current prompt and builds a stack with adjusted model weights
2. FunPackLoraLoader applies the stack to model and clip
3. refine_v2 receives the LoRA-patched model and applies the attn2
   direction patch on top

Removes the lora_stack return value - MODEL output already contains
everything (LoRA patches + direction injection). External lora_stack
input still accepted to bypass internal management entirely.

Adds mode (ltx2/wan) and per_block settings to the LoRA tab in popup,
stored in loras_config dict in studio_settings.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 19:18:41 +03:00
digital-garbageandClaude Sonnet 4.6 6cf4594397 FunPackStudio: add lora_stack output, unhide positive_prompt
- Add lora_stack (FUNPACK_LORA_STACK) as the 8th return value so the
  active stack flows out for downstream use
- Remove positive_prompt from hidden widgets so the text area is visible
  on the node face and can be connected as a link input

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 19:09:07 +03:00
digital-garbageandClaude Sonnet 4.6 47d0907030 FunPackStudio: override toggles for external inputs
Each input that has both a connected link and a popup value now has an
"Override" toggle below it (default off). Off = external input wins,
popup value is a fallback. On = popup value wins regardless.

Applies to: refinement_key (Session tab), feedback_prompt and
user_intent_prompt (Refiner tab). All other settings are popup-only
and unaffected.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 19:00:45 +03:00
digital-garbageandClaude Sonnet 4.6 cb22c8113f Add FunPackStudio: unified node for all FunPack refinement tools
FunPackStudio combines Refinement Key, Scene Builder, Refiner V2,
Advisor LLM, LoRA loading, and Conditioning Adjust under a single node
with a tabbed popup editor. Rating widget stays on the node face;
everything else is in the popup.

Python:
- FunPackStudio.run() chains all subsystems: scene builder prompt
  construction, advisor LLM load (using shared cache), LoRA loading via
  FunPackLoraLoader, FunPackVideoRefinerV2.refine_v2(), and
  FunPackConditioningAdjust.adjust(). No code duplication.
- Added optional _seed parameter to FunPackVideoRefinerV2.refine_v2()
  so Studio can generate a seed and output it for wiring to samplers.
- Added /funpack/available_loras endpoint for the LoRA picker.

JS (funpack_studio.js):
- Tabbed popup: Session, Scene, Refiner, Advisor, LoRA, Adjustments.
- Session: refinement key, reset toggle, scene builder mode selector.
- Scene: scene load/save, phrase bank from memory, positive prompt
  editor (active when scene builder is not Pass-through).
- Refiner: all V2 settings, feedback prompt, intent override.
- Advisor: LLM enable toggle, model path, dtype.
- LoRA: dynamic list of LoRAs with name/type/model-weight/clip-weight,
  loaded from /funpack/available_loras.
- Adjustments: phrase/strength pairs with session phrase bank.
- Settings serialized as JSON in hidden studio_settings widget.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 18:56:25 +03:00
digital-garbageandClaude Sonnet 4.6 ffb447104e Fix FunPackConditioningAdjust UI: use native button widget instead of custom widget
addCustomWidget failed silently in this ComfyUI version. Switch to
node.addWidget("button",...) which is natively supported. Also add the
same hideWidget retry timing pattern Scene Builder uses (rAF + two
setTimeout calls) so the adjustments text widget reliably disappears
after the node is created or reconfigured.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 17:13:42 +03:00
digital-garbage 644cd7629a Fix scene builder mode and add refiner learning mode 2026-05-15 13:07:41 +03:00
digital-garbage 9212fa1e27 Preserve saved scene prompt order 2026-05-14 15:55:38 +03:00
digital-garbage eb7b0f4f21 Preserve scene prompt insertion cursor 2026-05-14 15:50:01 +03:00
digital-garbage f294afa452 Inline scene prompt highlights 2026-05-14 15:39:24 +03:00
digital-garbage c67a12a852 Combine scene prompt highlights with editor 2026-05-14 15:28:30 +03:00
digital-garbage 005520e2aa Add scene preconstruct editor tools 2026-05-14 15:23:47 +03:00
digital-garbage 4a55d56373 Improve scene database phrase editing 2026-05-14 13:23:43 +03:00
digital-garbage 001e0d8f02 Highlight used scene prompt chips 2026-05-14 13:07:43 +03:00
digital-garbage 05efe8fb24 Improve scene builder empty-scene flow 2026-05-14 12:54:02 +03:00
digital-garbage 83b0ae326a Hide scene builder internals 2026-05-14 12:42:23 +03:00
digital-garbage b4098aee2a Simplify scene builder wildcards 2026-05-14 12:28:17 +03:00
digital-garbage 2d1e4313d3 Rework scene builder editor 2026-05-14 09:55:18 +03:00
digital-garbage 789f56a461 Refine Scene Builder editor 2026-05-13 23:00:40 +03:00
digital-garbage 71aad9e3d4 Add Scene Builder learning mode 2026-05-13 22:34:33 +03:00
digital-garbage 325bb3721c Simplify Scene Builder surface 2026-05-13 22:27:51 +03:00
digital-garbage a38fea93b7 Add FunPack Scene Builder 2026-05-13 22:10:25 +03:00
digital-garbage 8305e44f2a Merge remote-tracking branch 'origin/main' into dev
# Conflicts:
#	CHANGELOG.md
#	README.md
#	conditioning.py
#	docs/FunPackVideoRefinerV2.md
#	pyproject.toml
2026-05-13 12:52:48 +03:00
digital-garbage e716b37264 Add refiner vision context and velocity research hooks 2026-05-13 12:36:07 +03:00
digital-garbage 78dc9252f6 Release Refiner V2 appearance safety 2026-05-08 19:28:00 +03:00
digital-garbage f722a06526 Add video refiner v2 2026-05-07 20:04:44 +03:00
digital-garbage 47a8d81724 Add FunPack template manager 2026-05-02 11:20:49 +03:00
digital-garbage 0eaeabbbc4 Serialize compact LoRA rows as a list 2026-04-24 15:28:28 +03:00