Skip to content

Sync with upstream master, including Qwen-Image-2.1 support - #15

Merged
danielhanchen merged 76 commits into
masterfrom
sync-upstream-20260921
Sep 21, 2026
Merged

danielhanchen merged 76 commits into
masterfrom
sync-upstream-20260921

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Syncs the fork with upstream master, which is 75 commits ahead of us. The reason to do it now is that upstream merged Qwen-Image-2.1 support (leejet#1994, 2026-09-20), and the prebuilt binaries Studio installs from this repo are from 2026-09-07, so nothing we publish can load a Qwen-Image-2.1 GGUF today.

The merge

Upstream moved the body of src/stable-diffusion.cpp into src/pipeline/*, so a plain merge conflicts across two large regions of that file. Resolution: take the upstream copy of src/stable-diffusion.cpp wholesale, then re-apply our local guards where the code now lives.

Our two source guards:

  • The img_gen refusal for MiniMax-H3 is now upstream in src/pipeline/image.cpp, so it is dropped here rather than carried as a duplicate.
  • The CFG-free guard is not upstream. It moves to src/pipeline/request.cpp, beside the other guidance normalisation, unchanged in behaviour.

Everything else merged cleanly: the 1-D norm sparing in src/model_loader.cpp, the LTX audio VAE change, and the whole prebuilt CI apparatus including the Windows Authenticode signing.

Verification

The merged tree is upstream plus exactly our 13 files, nothing else:

.github/actions/sign-windows/action.yml          | 150 ++++
.github/scripts/assert-windows-bundle-signed.ps1 |  98 +++
.github/scripts/sign-windows-tree.ps1            | 161 +++++
.github/workflows/build.yml                      |  23 +-
.github/workflows/unsloth-sd-prebuilt.yml        | 877 +++++++++++++++++++++++
scripts/unsloth/additive_merge.py                | 196 +++++
scripts/unsloth/assemble_metadata.py             | 105 +++
scripts/unsloth/assert_macho_minos.sh            |  76 ++
scripts/unsloth/package_bundle.py                | 129 ++++
scripts/unsloth/pr-set.json                      |  24 +
src/model/vae/ltx_audio_vae.hpp                  |  29 +-
src/model_loader.cpp                             |  12 +
src/pipeline/request.cpp                         |   9 +

git rev-list --left-right --count upstream/master...HEAD reports 0 17: nothing of upstream is missing.

The same upstream revision (c678dfe) was already built locally with CUDA sm_100 and used for the whole Qwen-Image-2.1 quantization campaign, so this code is known to load and render that architecture on real hardware: bf16 renders at 1024 in 23.2s, and the GGUF conversions render correctly.

After this merges

A prebuilt release has to be cut, otherwise the Studio installer keeps handing out the 2026-09-07 binaries and every Qwen-Image-2.1 GGUF stays unloadable.

stduhpf and others added 30 commits August 11, 2026 22:57
Co-authored-by: leejet <leejet714@gmail.com>
Co-authored-by: leejet <leejet714@gmail.com>
Co-authored-by: leejet <leejet714@gmail.com>
CAHbKA-IV and others added 25 commits September 14, 2026 00:01
Co-authored-by: leejet <leejet714@gmail.com>
Co-authored-by: leejet <leejet714@gmail.com>
Upstream moved the body of src/stable-diffusion.cpp into src/pipeline/*, so that file is taken
wholesale from upstream and our two local guards are re-applied where the code now lives.

The img_gen refusal for MiniMax-H3 is already upstream in src/pipeline/image.cpp, so it is dropped
here rather than duplicated. The CFG-free guard is not, and moves to src/pipeline/request.cpp
beside the other guidance normalisation.

Brings in Qwen-Image-2.1 support (leejet#1994), which the prebuilts we publish do not have.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@danielhanchen
danielhanchen deployed to release-signing September 21, 2026 13:43 — with GitHub Actions Active

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8609f11320

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const char* embeddings_connectors_path;
const char* vae_path;
const char* audio_vae_path;
const char* audio_encoder_path;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve the public context-parameter ABI

When an application built against the previous public header calls sd_ctx_params_init, its sd_ctx_params_t allocation has the old size, but the new library executes *sd_ctx_params = {} using the enlarged layout and writes past that allocation; callers that skip the initializer instead have every field after this insertion misread and eventually read beyond the object in new_sd_ctx. Introduce a size/versioned API rather than enlarging this public by-pointer struct in place.

AGENTS.md reference: AGENTS.md:L71-L76

Useful? React with 👍 / 👎.

int* num_frames_out,
sd_audio_t** audio_out);
sd_audio_t** audio_out,
int* fps_out);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep the existing generate_video calling convention

When an already-compiled C client loads the updated shared library, the exported symbol name is unchanged but the caller still supplies only five arguments; the implementation interprets an unspecified register or stack slot as fps_out and, when it appears non-null, writes through that garbage pointer. Preserve the five-argument function and expose the FPS through a new symbol or another backward-compatible mechanism.

AGENTS.md reference: AGENTS.md:L71-L76

Useful? React with 👍 / 👎.


enum sd_log_level_t {
SD_LOG_DEBUG,
SD_LOG_VERBOSE,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the existing log-level enum values

For precompiled callback users, inserting this value changes SD_LOG_INFO/WARN/ERROR from 1/2/3 to 2/3/4. The new library can therefore make an old callback misclassify every message, and an old callback that indexes a four-entry table by the enum can access past its end when receiving SD_LOG_ERROR. Assign explicit legacy ordinals and append the new level without renumbering them.

AGENTS.md reference: AGENTS.md:L71-L76

Useful? React with 👍 / 👎.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-21T13:51:02.556324Z 8609f11 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@danielhanchen
danielhanchen merged commit 1d02858 into master Sep 21, 2026
17 checks passed

This branch was successfully deployed

1 active deployment
release-signing 8609f113 Deployed Sep 21, 2026 by danielhanchen via win-cpu-x64 #91
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.