Commit Graph
20 Commits
Author SHA1 Message Date
Jason HokuandClaude Opus 4.6 c9234ea78e fix: mock V3 API execution context for SeedVR2 node calls
SeedVR2 nodes use ComfyUI's V3 API which calls get_executing_context()
internally to get the current node_id. When calling execute() directly
from our code (outside ComfyUI's execution pipeline), the context is
None, causing AttributeError.

Fix: wrap all SeedVR2 execute() calls inside a CurrentNodeContext
context manager with a dummy prompt_id and node_id. This provides the
required execution context that V3 API nodes expect.

Also fixed indentation — all three execute() calls (DiT, VAE, Upscaler)
are now properly inside the with block.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 14:06:46 -07:00
Jason HokuandClaude Opus 4.6 96726094bd fix: SeedVR2 node discovery via NODE_CLASS_MAPPINGS, not module import
The previous approach tried 'from custom_nodes import ComfyUI_SeedVR2...'
which fails because ComfyUI doesn't expose custom nodes as importable
packages. Now scans nodes.NODE_CLASS_MAPPINGS directly for the three
SeedVR2 node classes (LoadDiTModel, LoadVAEModel, VideoUpscaler).
This works for both V2 and V3 API nodes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 13:33:03 -07:00
Jason HokuandClaude Opus 4.6 9e7911aa23 feat: SeedVR2 upscale mode in Builder UI and Dashboard
Adds SeedVR2 as a new upscale mode alongside HiRes Fix, Model Upscale,
and Model+HiRes. Requires ComfyUI-SeedVR2_VideoUpscaler to be installed
as a dependency — the plugin calls its nodes programmatically.

Data Model:
- New seedvr2 options object on each upscale step with all SeedVR2
  parameters: dit_model, resolution, max_resolution, seed,
  color_correction, batch_size, noise scales, blocks_to_swap,
  attention_mode, offload_device, cache_model, VAE tiling options
- _defaultSeedVR2Options() / createDefaultSeedVR2Options() helpers
- Migration: ensureStepFields adds seedvr2 defaults to existing configs

Builder UI (conf-builder-config-management.js):
- "SeedVR2 Upscale" added to mode dropdown
- When selected, shows full SeedVR2 settings: DiT model selection
  (10 variants: 3B/7B x fp16/fp8/GGUF/sharp), resolution, seed,
  color correction, noise scales, batch size, VRAM optimization
  (blocks_to_swap, attention_mode, offload), VAE tiling with
  conditional encode/decode tile size and overlap fields

Dashboard (logic_upscale_modal.js):
- Same SeedVR2 mode and fields in renderPipelineEditor via _renderStep
- All fields use existing _makeSelect/_makeNumber/_makeCheckbox helpers

Python Execution (image_generation.py):
- New seedvr2_upscale(pil_image, seedvr2_config) function
- Imports SeedVR2 nodes from NODE_CLASS_MAPPINGS at runtime
- Calls SeedVR2LoadDiTModel → SeedVR2LoadVAEModel → SeedVR2VideoUpscaler
- Converts PIL→tensor→SeedVR2→tensor→PIL
- Clear error if SeedVR2 not installed

Pipeline Integration (generation_orchestrator.py):
- Inline upscale path: mode=="seedvr2" branch decodes current latent
  to PIL, calls seedvr2_upscale, saves result, updates manifest
- Supports chained steps: non-final SeedVR2 steps re-encode to latent
  for the next step in the pipeline

Preset compatible: seedvr2 config serializes naturally as JSON, saved
and loaded with upscale presets without any special handling.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 12:29:00 -07:00
Jason HokuandClaude Opus 4.6 0691c26d77 feat: add Flux2 support — CLIP type, model sampling, and override
- Add "flux2" to clip_types and dual_clip_types lists so CLIPType.FLUX2
  is correctly passed to ComfyUI's text encoder loader
- Add "flux2" model_sampling_override option in Builder UI dropdown
- Implement ModelSamplingFlux2 handler using fixed shift (default 2.02,
  matching ComfyUI's Flux2 supported_models.py)
- Handle "flux2" in config_builder_node.py config generation with
  default shift value

Users with Flux2 models (Klein, etc.) should set:
- CLIP Type: flux2
- Model Sampling Override: Flux2
- For best results: enable Advanced Sampling with Flux2 Scheduler

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 20:50:46 -07:00
Jason HokuandClaude Opus 4.6 d02484aae6 fix: improve ETA accuracy with rolling 10-job window
ETA calculation now uses the last 10 job durations instead of the
overall average. This adapts faster when upscale patterns change
(e.g., some configs have upscale, some don't) and prevents early
slow jobs from permanently skewing the estimate.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 19:34:52 -07:00
JasonHokuandClaude Opus 4.6 89b6ce4eb1 feat: upscale pipelines system + save pre-upscale + HiRes prompt adjust
Replace flat upscale configs with pipeline/steps/repeat architecture:
- Pipelines run independently from base image
- Steps chain sequentially within a pipeline
- Steps support repeat count for iterative refinement

Add "Save Pre-Upscaled Output" option to also keep the base image.

Add "Adjust Prompt During HiRes Fix" with prepend/append/replace
behaviors. HiRes-adjusted prompts are batch pre-encoded for efficiency.
Results written to manifest metadata and exposed as label overlays.

Fix fmtVal scoping error in buildLabelOverlay (was referenced outside
the upscale block where it was defined).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 15:33:04 -07:00
JasonHokuandClaude Opus 4.6 91b8598ac3 feat: add seed settings, canvas flicker fix, upscaling & GPU cooldown
- Seed: expanded per-gen behavior + new full run seed behavior (random/increment/decrement before/after entire run)
- Canvas: fix flicker during simultaneous pan+zoom via requestAnimationFrame batching
- Upscaling: 3 session-level modes (HiRes fix, model upscale, model+HiRes) with tiled VAE support
- Cooldown: configurable GPU breaks between generations with optional VRAM clearing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 14:00:06 -07:00
JasonHokuandClaude Opus 4.6 1e43776994 fix: free GPU memory before VAE decode + NaN diagnostics
Worker now clones latent and frees UNet tensors + CUDA cache before
VAE decode, giving Dynamic VRAM clean memory for VAE loading.
decode_latent_with_vae now detects NaN in input/output, logs diagnostic
info, retries with float32, and handles bfloat16->numpy conversion.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 14:25:09 -08:00
JasonHokuandClaude Opus 4.6 a71b9ed315 Add dashboard toggle to show/hide trigger words in prompts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 21:15:21 -08:00
JasonHokuandClaude Opus 4.6 45e738556a feat: add model sampling patches, FluxGuidance, and advanced sampling pipeline
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 18:24:13 -08:00
JasonHoku 5d3a76b246 distribution numpy img save fix, lora triggerword pathing fix 2026-02-26 17:16:02 -08:00
JasonHoku 820ff09df8 sorting optimization 3 2026-02-18 17:10:10 -08:00
JasonHoku d74a51dd15 UI updates, model based prompting, attention mode selection, recursive cartesian prompting, detect connected node changes for smarter job resuming, eta progress bar in ui, condensed dashboard top bar, close modal hotkeys, 2026-02-16 00:21:58 -08:00
JasonHoku d178bd064f Change cache busting static js serve technique to conform to ComfyUI best practices 2026-02-14 23:13:13 -08:00
JasonHoku ff9ec1aa9b Seed behavior, load any directory into the dashboard, better lora omit triggerword logic, builder validation & more ui changes. 2026-02-14 17:53:33 -08:00
JasonHoku d0aacb906e Config Builder View Lora CivitAI Data Buttons, Cleaner Manifest, Auto Card & Row Sizes In Grid, Fixed Config Builder Lora Always Combining Loras, Easier Lora UI Settings 2026-02-13 00:23:20 -08:00
JasonHoku 22ecccfbb8 Fix Qwen Decode 2026-02-06 15:47:57 -08:00
JasonHoku beb3402d93 Fixed Non Remote Vae Decode Image Saving Meta Mismatch, Fixed Config Meta Saving & R Reload Hotkey Filter Updates 2026-02-06 14:48:12 -08:00
JasonHoku 8cbf719f97 Fix Filepath In Manifest For Non-Remote Vae Saving 2026-02-06 13:14:13 -08:00
JasonHoku 9d1afab458 Major Refactor, Optimizations & New Features: Move & MetaPack Favorited, Random Lora Selection, Lora & Model Entire Folder Loading, Smart JSON Node, WIP Config Builder 2026-02-06 00:07:47 -08:00