Remove Stable Diffusion support (1.5, 2.1, 3.5 Medium) - #298
Merged
stikves merged 9 commits intoSep 29, 2026
Merged
Conversation
Repo cleanup before next release. Removes the classic UNet Stable Diffusion pipeline (1.5/2.1) and the SD3 MMDiT pipeline (3.5 Medium) across Swift, Python, docs, and the model card. FLUX.2, Sana/SanaSprint, and Wan are unaffected. Swift: delete StableDiffusionPipeline, SD3Pipeline(+Resources), the PNDM and DPMSolverMultistep schedulers, and SD3ParityDataTests; drop the stable-diffusion* PipelineType cases; relocate PredictionType into Scheduler.swift; remove the SD/SD3 dispatch and the trace/parity harness from diffusion-runner; default scheduler -> discreteFlow. Python: remove the SD/SD3 model rows, presets, export metadata, and the SD/SD3 component wrappers, registries, config builder and loader branches from the shared diffusion module; unknown pipeline types now raise. Docs: delete the stable-diffusion model card; drop SD references from the model index and examples. uv.lock and pyproject.toml are unchanged.
Satisfies CI lint (ruff format) and swift-format lint --strict on the files touched by the Stable Diffusion removal.
Co-authored-by: kevchengcodes <59463423+kevchengcodes@users.noreply.github.com>
- Single-source the supported pipeline types: derive SUPPORTED_PIPELINE_TYPES from SUPPORTED_MODELS and add a shared unknown_pipeline_type_error() helper; use it at all four raise sites (components.py, pipeline.py). - Drop tokenizer_2 support from _save_tokenizer — SD3 was the only two-tokenizer model; FLUX.2/Sana/Wan are single-tokenizer. - Add SANA_SPRINT_COMPONENTS to test_vae_components_stay_unquantized. - diffusion-runner: "CoreAI" -> "Core AI" in the command abstract; extract the generic floatsToNDArray helper out of the command struct into NDArrayConversion.swift (it is not diffusion/SD-specific).
Extract runParityTest / runFlux2ComponentParity and the NpyData / loadNpy / cosineSimilarity / floatsToNDArray helpers from the DiffusionRunner command into DiffusionRunnerMain+Parity.swift; the command file keeps only the hidden flag and its dispatch. floatsToNDArray now defers to CoreAIShared.fillFloatNDArray for float targets instead of duplicating the f16-safe fill. Addresses the review note that the tracing path is generic, not SD-specific.
stikves
requested review from
alejandro-isaza,
carinapeng,
kevchengcodes and
tjia1818
September 28, 2026 23:58
stikves
marked this pull request as ready for review
September 28, 2026 23:58
carinapeng
reviewed
Sep 29, 2026
carinapeng
reviewed
Sep 29, 2026
carinapeng
reviewed
Sep 29, 2026
carinapeng
reviewed
Sep 29, 2026
tjia1818
reviewed
Sep 29, 2026
kevchengcodes
approved these changes
Sep 29, 2026
tjia1818
approved these changes
Sep 29, 2026
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.
Repo cleanup before next release. Removes the classic UNet Stable Diffusion pipeline (1.5/2.1) and the SD3 MMDiT pipeline (3.5 Medium).