Skip to content

refactor: simplify diffusion model runner params#1569

Merged
leejet merged 1 commit into
masterfrom
refactor/diffusion-model-runner-params
May 27, 2026
Merged

refactor: simplify diffusion model runner params#1569
leejet merged 1 commit into
masterfrom
refactor/diffusion-model-runner-params

Conversation

@leejet

@leejet leejet commented May 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace wrapper-only diffusion model classes with DiffusionModelRunner, which inherits GGMLRunner, owns the tensor prefix, and lets concrete runners expose compute(DiffusionParams).
  • Shrink DiffusionParams to common inputs plus typed model-specific extras.
  • Remove ADM channel plumbing from diffusion/conditioner params and use the SDXL ADM width directly where needed.
  • Fix Flex.2 latent concat handling so Flux control-only logic no longer overwrites Flex.2 inpaint/control concat tensors.

Related Issue / Discussion

N/A

Additional Information

N/A

Checklist

@leejet leejet merged commit 55c2aed into master May 27, 2026
14 checks passed
dbrain added a commit to dbrain/hbd-longcat-avatar.cpp that referenced this pull request May 29, 2026
…ds + wrapper return-type

The new DiffusionModelRunner base (sd.cpp leejet#1569) leaves GGMLRunner's
alloc/free/get_params_buffer_size/set_weight_adapter non-virtual, so the
LongCatAvatarModel wrapper (which delegates to a nested runner holding the real
params) couldn't override them. Add virtual passthroughs on DiffusionModelRunner
(default -> GGMLRunner::, wrapper overrides -> nested runner). alloc_params_buffer
returns bool to match. get_adm_in_channels: dropped override (not a base method,
never base-ptr-dispatched). Avatar render verified pixel-identical (0/255).
@leejet leejet deleted the refactor/diffusion-model-runner-params branch May 31, 2026 17:45
RapidMark pushed a commit to CloudhandsAI/stable-diffusion.cpp that referenced this pull request Jun 1, 2026
…onParams

Upstream leejet#1569 ("simplify diffusion model runner params") split the monolithic
DiffusionParams into per-model Extra structs. Re-seated the PuLID-Flux feature
onto the new architecture:

- diffusion_model.hpp: pulid_id + pulid_id_weight added to FluxDiffusionExtra.
- flux.hpp: compute(DiffusionParams) now reads extra->pulid_id /
  extra->pulid_id_weight and threads them through to build_graph (the PuLID
  cross-attention code itself merged cleanly).
- stable-diffusion.cpp: the FluxDiffusionExtra construction carries the PuLID
  id embedding + weight; obsolete monolithic param assignments dropped.

Verified end-to-end on three GPUs/backends (compiles + the 3-way off / zero-weight
/ on PuLID falsification all pass; zero-weight is byte-identical to baseline,
weight 1.0 alters output and preserves identity):
- AMD R9700 (RDNA4, ROCm)
- AMD RX 6700 XT (RDNA2, Vulkan)
- NVIDIA RTX 3060 (Vulkan)
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.

1 participant