SUPIR: scaffold pipeline + design doc (refs #7219)#13563
Draft
MukundaKatta wants to merge 1 commit intohuggingface:mainfrom
Draft
SUPIR: scaffold pipeline + design doc (refs #7219)#13563MukundaKatta wants to merge 1 commit intohuggingface:mainfrom
MukundaKatta wants to merge 1 commit intohuggingface:mainfrom
Conversation
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.
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
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—_LazyModulewiring behindis_torch_available + is_transformers_available.src/diffusers/pipelines/supir/pipeline_supir.py—SUPIRPipeline(DiffusionPipeline, StableDiffusionMixin)with documented__init__, full__call__signature (29 params),SUPIRPipelineOutputdataclass. Helper stubs and__call__heavy path raiseNotImplementedErrorpointing atSUPIR_DESIGN.md.src/diffusers/__init__.py,src/diffusers/pipelines/__init__.py— wired into both_import_structureandTYPE_CHECKINGimport blocks.src/diffusers/utils/dummy_torch_and_transformers_objects.py— addedSUPIRPipelinedummy.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 checkclean on all touched files.from diffusers import SUPIRPipeline.