feat: add LLaDA-Image support - #1968
Draft
fszontagh wants to merge 3 commits into
Draft
Conversation
leejet
requested changes
Sep 13, 2026
Owner
There was a problem hiding this comment.
Please put merge and vocab on a single line, and remove the helper scripts.
fszontagh
force-pushed
the
feat/llada-image
branch
from
September 13, 2026 17:06
18638c9 to
c1e7233
Compare
fszontagh
force-pushed
the
feat/llada-image
branch
from
September 13, 2026 17:19
c1e7233 to
f642157
Compare
fszontagh
marked this pull request as draft
September 13, 2026 18:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds text-to-image and instruction-guided editing for
LLaDA-Image (Apache-2.0). The denoiser is a
Lumina2/Z-Image-style NextDiT conditioned by a LLaDA2-MoE diffusion-LLM text encoder, and it
reuses the Flux.2 VAE.
Most of it reuses what is already here:
ZImage::JointTransformerBlock/FinalLayer; the hyperparameters areidentical. Z-Image's blocks gained two defaulted parameters,
norm_elementwise_affine(LLaDA's norms are parameter-free) and
split_qkv(its checkpoint keeps q/k/v separate).LLMArch::LLADA2_MOEon the existing MoE path, addinggrouped-sigmoid routing with an expert bias, a shared expert, partial rotary and
bidirectional attention.
weights are present), plus the
llada_imagereference-image preset and sigma schedule.Editing runs the clean reference and the noisy target in one sequence. Because adaLN is a
linear map of the timestep embedding, feeding a per-token embedding selects the right
modulation exactly, so no new modulation machinery was needed.
One change outside the model:
tensor_should_be_convertednow skips*_pad_token.LLaDA-Image stores those around 7.7e24, so f16 storage and q8_0's f16 block scale both
overflow to inf, and every GGUF I converted rendered blank white until this was added.
Docs in
docs/llada_image.md; rows added toREADME.mdanddocs/edit.md. The connectorcomponents ship in separate directories, so the docs show how to merge them into the one file
--embeddings-connectorsexpects, and link pre-merged copies.Related Issue / Discussion
Closes #1937
Additional Information
Verified on an RTX 3060 12GB, CUDA, with LLaDA-Image-Turbo
int8_tensorwiseand with q8_0 andf16 GGUFs converted by
-M convert, against a Q4_K text encoder. No offload flags are needed.assets/llada_image/example.pngis"a lovely cat holding a sign says 'llada.cpp'";edit_example.pngis that image with"change the sign text to 'sd.cpp'".Segmented execution was checked against unconstrained execution at 512x512:
--max-vram 6,--max-vram 4,--max-vram 3and--offload-to-cpuall produce byte-identical output, so theroughly 16 GB of weights run in a 3 GB budget.
Editing packs reference and target in one sequence, so it needs about twice the tokens of
text-to-image at the same size; at 1024x1024 on 12 GB it needs
--diffusion-fa.Not implemented:
generation_mode="vq", where the text encoder block-diffusion-decodes VQtokens before diffusion. Text-to-image and editing do not use that path. Tested with
int8_tensorwiseand GGUF quantizations only.Checklist