Skip to content

SUPIR: scaffold pipeline + design doc (refs #7219)#13563

Draft
MukundaKatta wants to merge 1 commit intohuggingface:mainfrom
MukundaKatta:feat/supir-pipeline-scaffold
Draft

SUPIR: scaffold pipeline + design doc (refs #7219)#13563
MukundaKatta wants to merge 1 commit intohuggingface:mainfrom
MukundaKatta:feat/supir-pipeline-scaffold

Conversation

@MukundaKatta
Copy link
Copy Markdown

Summary

Refs #7219. Scaffold and design doc for SUPIRPipeline. The full SUPIR pipeline (degradation-robust SDXL VAE encoder, trimmed ControlNet with ZeroSFT, restoration-guided EDM sampler, optional LLaVA captioning, custom modules, weight conversion) is significant work — this PR lands the API surface, dummy gating, and tests so the porting work can land incrementally.

What's in this PR

  • SUPIR_DESIGN.md (root) — porting plan, 5 staged components, weight conversion notes, open questions.
  • src/diffusers/pipelines/supir/__init__.py_LazyModule wiring behind is_torch_available + is_transformers_available.
  • src/diffusers/pipelines/supir/pipeline_supir.pySUPIRPipeline(DiffusionPipeline, StableDiffusionMixin) with documented __init__, full __call__ signature (29 params), SUPIRPipelineOutput dataclass. Helper stubs and __call__ heavy path raise NotImplementedError pointing at SUPIR_DESIGN.md.
  • src/diffusers/__init__.py, src/diffusers/pipelines/__init__.py — wired into both _import_structure and TYPE_CHECKING import blocks.
  • src/diffusers/utils/dummy_torch_and_transformers_objects.py — added SUPIRPipeline dummy.
  • tests/pipelines/supir/test_supir.py — locks __init__/__call__ parameter lists; xfail(strict=True) on the end-to-end test.

What this PR is not

A working pipeline. Marked draft for that reason — happy to take direction on whether to proceed in this PR, in stacked PRs, or via a tracking issue with separate PRs per stage.

Test plan

  • ruff check clean on all touched files.
  • Pipeline class loads under from diffusers import SUPIRPipeline.
  • Test file imports the class and asserts the API surface (xfail until implemented).

Adds the public API surface for an upcoming SUPIR (Scaling Up to
Excellence) image restoration pipeline so docs, typing, and tests can
land incrementally while the heavy porting work proceeds.

This is a SCAFFOLD ONLY:
- new src/diffusers/pipelines/supir/ with SUPIRPipeline class wiring
  vae / text_encoder(_2) / tokenizer(_2) / unet / controlnet / scheduler
  components and the documented __call__ argument surface;
- all heavy paths (encode_prompt, prepare_low_quality_latents,
  restoration_guided_step, __call__) raise NotImplementedError and
  point at SUPIR_DESIGN.md;
- gated behind is_torch_available + is_transformers_available with a
  matching dummy class in dummy_torch_and_transformers_objects.py;
- exposed from the top-level diffusers namespace and the pipelines
  subpackage following the existing _LazyModule pattern;
- tests/pipelines/supir/test_supir.py pins the public __call__ and
  __init__ signatures and xfails the (not-yet-existing) end-to-end run.

SUPIR_DESIGN.md at the repo root captures the porting plan from
Fanghua-Yu/SUPIR: degradation-robust encoder, trimmed ControlNet
adaptor with ZeroSFT connector, SDXL UNet generative prior,
restoration-guided sampler, optional LLaVA caption guidance, and the
weight-conversion path.

No working pipeline yet; calling SUPIRPipeline raises NotImplementedError.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant