GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: improve GGUF metadata parsing and reader selection by losewayy · Pull Request #2062 · leejet/stable-diffusion.cpp

Conversation

@losewayy

@losewayy losewayy commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Issue #1953 asked about Wan2.2 VACE. Testing showed the existing VACE path already handles the new checkpoints correctly once they are loaded — the real obstacles were two problems in the GGUF reading path:

1. Misleading errors when loading >4-dim tensors. Wan2.2 GGUFs (QuantStack) store conv3d weights as 5-dim tensors (patch_embedding.weight, vace_patch_embedding.weight). gguf_init_from_file rejects them with invalid number of dimensions: 5 > 4 and logs an ERROR, even though the extended reader folds them correctly — which made these models look unsupported. Wan2.1_14B_VACE and Wan2.2-T2V GGUFs carry the same 5-dim tensors, so this affects the whole Wan 14B family.

2. A latent bug in the extended reader's ARRAY metadata parsing. It read each array element as a full key-value pair, but GGUF array elements are raw values (no key/type headers). Any file with array-typed metadata (e.g. the ~32k tokenizer vocabulary in umt5-xxl-encoder) fails in that path — which went unnoticed because the extended reader only runs as a fallback.

Changes:

  • gguf_reader_ext.h: parse ARRAY metadata by element type (fixed-size seeks / per-string skips); add has_tensors_beyond_ggml_limits().
  • gguf_io.cpp: do a cheap header scan first; files declaring >4-dim tensors go straight to the extended reader instead of calling gguf_init_from_file, which is guaranteed to fail. All other files keep the existing behavior (gguf first, reader as fallback).

Also added a docs/wan.md section for Wan2.2 VACE-Fun A14B (MoE expert pair usage) and a generated sample clip.

Related Issue / Discussion

Fix #1953.

Additional Information

Verified locally on an RTX 5070 Ti (CUDA):

  • Wan2.2-VACE-Fun-A14B Q3_K_S high/low-noise experts: R2V produces coherent reference-conditioned output (sample in assets/wan/), T2V runs cleanly
  • Regular GGUFs (umt5-xxl-encoder Q8_0) load unchanged
  • A truncated file still fails cleanly, no crash

Not covered: Vulkan backend (the code path is backend-agnostic; the issue reporter offered to verify), V2V control video (shares the Wan2.1 VACE path).

Checklist

  • I have read and confirmed this PR follows the contribution guidelines.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
losewayy and others added 2 commits September 26, 2026 02:54
@losewayy
feat: support Wan2.2 VACE
6538705
- route GGUFs declaring >4-dim tensors to the extended reader instead of
  gguf_init_from_file, which rejects them with a misleading ERROR
- fix the extended reader's ARRAY metadata parsing: elements are raw
  values, not key-value entries
- document Wan2.2 VACE-Fun A14B (MoE expert pair) and add a sample clip
@leejet
fix: validate GGUF metadata lengths and unify value parsing
92b02e1
@leejet
leejet merged commit 168f7b8 into leejet:master Sep 27, 2026
9 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@leejet

leejet commented Sep 27, 2026

Copy link
Copy Markdown
Owner

I’ve updated the PR title to use fix:. Wan2.2 VACE is already supported by the existing implementation; this PR fixes GGUF metadata parsing, avoids misleading errors when loading five-dimensional tensors, and adds usage documentation.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@losewayy losewayy changed the title feat: support Wan2.2 VACE fix: improve GGUF metadata parsing and reader selection Sep 30, 2026
@losewayy
losewayy deleted the wan22-vace branch October 6, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Wan 2.2 VACE support in vid_gen (reference-to-video / video editing)

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@losewayy @leejet
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.