Skip to content

Remove Stable Diffusion support (1.5, 2.1, 3.5 Medium) - #298

Merged
stikves merged 9 commits into
apple:mainfrom
stikves:sukru/remove-legacy-stable-diffusion
Sep 29, 2026
Merged

stikves merged 9 commits into
apple:mainfrom
stikves:sukru/remove-legacy-stable-diffusion

Conversation

@stikves

@stikves stikves commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Repo cleanup before next release. Removes the classic UNet Stable Diffusion pipeline (1.5/2.1) and the SD3 MMDiT pipeline (3.5 Medium).

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.
Comment thread python/src/coreai_models/diffusion/pipeline.py Outdated
Comment thread python/src/coreai_models/diffusion/pipeline.py Outdated
Comment thread python/tests/test_model_units/test_export/test_diffusion_compression.py Outdated
Comment thread swift/Sources/Tools/diffusion-runner/DiffusionRunnerMain.swift Outdated
Comment thread swift/Sources/Tools/diffusion-runner/DiffusionRunnerMain.swift
stikves and others added 4 commits September 28, 2026 15:55
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 stikves self-assigned this Sep 28, 2026
@stikves
stikves marked this pull request as ready for review September 28, 2026 23:58
Comment thread swift/Sources/Tools/diffusion-runner/DiffusionRunnerMain.swift Outdated
Comment thread swift/Tests/DiffusionPipelineTests/SD3ParityDataTests.swift Outdated
Comment thread swift/Tests/DiffusionPipelineTests/DiffusionPipelineTests.swift
Comment thread python/src/coreai_models/diffusion/components.py
@stikves
stikves merged commit e1df4c8 into apple:main Sep 29, 2026
3 checks passed
@stikves
stikves deleted the sukru/remove-legacy-stable-diffusion branch September 29, 2026 20:44
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.

4 participants