Skip to content

SeedVR2 native: drop disk-load prompt embeddings, restore checkpoint buffer access#54

Merged
pollockjj merged 1 commit into
issue_101from
issue_224_drop_disk_load_v2
May 8, 2026
Merged

SeedVR2 native: drop disk-load prompt embeddings, restore checkpoint buffer access#54
pollockjj merged 1 commit into
issue_101from
issue_224_drop_disk_load_v2

Conversation

@pollockjj
Copy link
Copy Markdown
Owner

Summary

Pure reversion. PR #51 introduced _load_seedvr2_prompt_embed[s] and _SEEDVR2_PROMPT_EMBED_CANDIDATES in comfy_extras/nodes_seedvr.py, making SeedVR2Conditioning.execute load pos_emb.pt / neg_emb.pt from one of four search paths via folder_paths.get_full_path — three of which point inside the numz and canonical custom_node directories. Native SeedVR2 inference became silently dependent on third-party custom_nodes being present on disk; disabling the numz pack made the node raise FileNotFoundError.

This PR removes that contamination and restores Yusef's upstream pattern: read model.positive_conditioning and model.negative_conditioning directly off the diffusion model. The official seedvr2_3b_fp16vae.safetensors checkpoint ships both as model-level buffers (positive 58×5120 bf16, negative 64×5120 bf16, registered in comfy/ldm/seedvr/model.py and populated by the state-dict load).

Net diff

2 files changed, 2 insertions(+), 243 deletions(-)

Deletions only.

Changes

comfy_extras/nodes_seedvr.py

  • Remove import folder_paths.
  • Remove _SEEDVR2_PROMPT_EMBED_CANDIDATES.
  • Remove _load_seedvr2_prompt_embed and _load_seedvr2_prompt_embeds.
  • SeedVR2Conditioning.execute reads pos_cond = model.positive_conditioning and neg_cond = model.negative_conditioning.

The disable_model_cfg1_optimization() call (also added by PR #51) is preserved — that part of PR #51 is correct.

tests-unit/comfy_extras_test/test_seedvr_conditioning_hardening.py

  • Remove the four _load_seedvr2_prompt_embed* unit tests.
  • Remove the _load_seedvr2_prompt_embeds monkey-patch line in test_seedvr2_conditioning_disables_cfg1_optimization. The existing _DiffusionModel test fixture already registers positive_conditioning and negative_conditioning via register_buffer, which is exactly the contract the reverted execute path consumes.

Linked

…buffer access

PR #51 introduced _load_seedvr2_prompt_embed[s] and _SEEDVR2_PROMPT_EMBED_CANDIDATES, making SeedVR2Conditioning load pos_emb.pt / neg_emb.pt from one of four search paths inside the numz and canonical custom_node directories via folder_paths.get_full_path. Native inference became silently dependent on third-party custom_nodes being present on disk.

Yusef's upstream PR (Comfy-Org#11294) reads model.positive_conditioning and model.negative_conditioning as buffers. The official seedvr2_3b_fp16vae.safetensors checkpoint ships both buffers (positive 58x5120 bf16, negative 64x5120 bf16). This PR restores that path.

Pure reversion. Deletions only across two files.

comfy_extras/nodes_seedvr.py

  - Remove import folder_paths.

  - Remove _SEEDVR2_PROMPT_EMBED_CANDIDATES.

  - Remove _load_seedvr2_prompt_embed and _load_seedvr2_prompt_embeds.

  - SeedVR2Conditioning.execute reads pos_cond and neg_cond off model directly.

tests-unit/comfy_extras_test/test_seedvr_conditioning_hardening.py

  - Remove the four _load_seedvr2_prompt_embed* unit tests.

  - Remove the _load_seedvr2_prompt_embeds monkey-patch line in test_seedvr2_conditioning_disables_cfg1_optimization (the existing _DiffusionModel test fixture already register_buffers the conditioning, which is exactly the contract the reverted execute path consumes).

Tracking: pollockjj/mydevelopment#224
Copilot AI review requested due to automatic review settings May 8, 2026 05:16
@pollockjj pollockjj merged commit bb54dbd into issue_101 May 8, 2026
10 checks passed
@pollockjj pollockjj deleted the issue_224_drop_disk_load_v2 branch May 8, 2026 05:22
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Reverts SeedVR2 conditioning to use prompt-embedding buffers shipped inside the SeedVR2 diffusion checkpoint, removing the runtime dependency on on-disk pos_emb.pt / neg_emb.pt files (and third-party custom_nodes search paths). This restores the native/upstream behavior described in the PR metadata.

Changes:

  • Remove filesystem-based prompt embedding discovery/loading helpers from comfy_extras/nodes_seedvr.py.
  • Update SeedVR2Conditioning.execute to read model.positive_conditioning / model.negative_conditioning directly.
  • Remove unit tests that were specific to the deleted disk-load helpers and simplify the remaining conditioning hardening test accordingly.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
comfy_extras/nodes_seedvr.py Removes disk-based prompt embedding loading and switches conditioning to model-provided buffers.
tests-unit/comfy_extras_test/test_seedvr_conditioning_hardening.py Deletes tests for removed loader helpers and updates the remaining conditioning test to use the model fixture’s registered buffers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +317 to +318
pos_cond = model.positive_conditioning
neg_cond = model.negative_conditioning
Comment on lines 314 to 319
model_patcher = model
model = _resolve_seedvr2_diffusion_model(model_patcher)
model_patcher.disable_model_cfg1_optimization()
pos_cond, neg_cond = _load_seedvr2_prompt_embeds(device, model.positive_conditioning.dtype)
pos_cond = model.positive_conditioning
neg_cond = model.negative_conditioning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants