Add PRXPixelPipeline: pixel-space PRX text-to-image pipeline by DavidBert · Pull Request #13928 · huggingface/diffusers · GitHub
Skip to content

Add PRXPixelPipeline: pixel-space PRX text-to-image pipeline - #13928

Merged
dg845 merged 1 commit into
huggingface:mainfrom
Photoroom:prx-pixel
Jun 17, 2026
Merged

dg845 merged 1 commit into
huggingface:mainfrom
Photoroom:prx-pixel

Conversation

@DavidBert

@DavidBert DavidBert commented Jun 12, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds a pixel-space variant of PRX that denoises raw RGB directly (no VAE), conditioned on a Qwen3-VL text encoder:

  • PRXTransformer2DModel: new optional config args bottleneck_size (two-layer img_in projection for large patch dims) and resolution_embeds (PRXResolutionEmbedder conditions the timestep modulation on the latent resolution)
  • PRXPipeline: support for subclass-tuned tokenizer max length, light text cleaning, x-prediction flow matching (x0 -> velocity conversion), and non-unit initial noise scale
  • PRXPixelPipeline: thin subclass wiring the above together (vae optional/None, vae_scale_factor=1, 1024px default)
  • conversion script support for the pixel checkpoint format
  • registration in init files + dummy objects, docs autodoc entry, fast pipeline tests

Before submitting

Who can review?

@dg845

@github-actions github-actions Bot added size/L PR with diff > 200 LOC documentation Improvements or additions to documentation models tests utils pipelines and removed size/L PR with diff > 200 LOC labels Jun 12, 2026
@dg845
dg845 self-requested a review June 13, 2026 05:21
Comment thread src/diffusers/pipelines/prx/pipeline_prx.py Outdated
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

Comment thread src/diffusers/pipelines/prx/pipeline_prx.py Outdated
Comment thread src/diffusers/pipelines/prx/pipeline_prx_pixel.py Outdated
Comment thread tests/pipelines/prx/test_pipeline_prx_pixel.py Outdated

@dg845 dg845 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Left an initial design review :).

@github-actions

Copy link
Copy Markdown
Contributor

Hi @DavidBert, thanks for the PR! It does not appear to link an issue it fixes. If this PR addresses an existing issue, please add a closing keyword (e.g. Fixes #1234) to the PR description so the issue is linked. See the contribution guide for more details. If this PR intentionally does not fix a tracked issue, a maintainer can add the no-issue-needed label to silence this reminder.

@github-actions github-actions Bot added the size/L PR with diff > 200 LOC label Jun 15, 2026
Comment thread src/diffusers/models/transformers/transformer_prx.py Outdated
Comment thread src/diffusers/models/transformers/transformer_prx.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the vae should be removed rather than retained as an optional component for PRXPixelPipeline. My understanding is that if a non-trivial VAE is supplied with either vae_scale_factor > 1 or self.vae.config.latent_channels != self.transformer.config.in_channels, the code will break.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — agreed. vae has been removed entirely from PRXPixelPipeline (the __init__ signature, register_modules, _optional_components, and model_cpu_offload_seq). vae_scale_factor is now a simple property returning 1. The Hub checkpoint's model_index.json also needs the "vae": [null, null] entry removed so from_pretrained continues to work — updating that separately.

Comment thread tests/pipelines/prx/test_pipeline_prx_pixel.py Outdated
Comment thread docs/source/en/_toctree.yml

@dg845 dg845 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for iterating! Left some follow up comments.

Adds a pixel-space variant of PRX that denoises raw RGB directly
(no VAE), conditioned on a Qwen3-VL text encoder:

- PRXTransformer2DModel: new optional config args `bottleneck_size`
  (two-layer img_in projection for large patch dims) and
  `resolution_embeds` (PRXResolutionEmbedder conditions the timestep
  modulation on the latent resolution)
- PRXPipeline: support for subclass-tuned tokenizer max length, light
  text cleaning, x-prediction flow matching (x0 -> velocity conversion),
  and non-unit initial noise scale
- PRXPixelPipeline: thin subclass wiring the above together
  (vae optional/None, vae_scale_factor=1, 1024px default)
- conversion script support for the pixel checkpoint format
- registration in __init__ files + dummy objects, docs autodoc entry,
  fast pipeline tests

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@dg845 dg845 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work on this PR!

@dg845
dg845 merged commit a487e2f into huggingface:main Jun 17, 2026
15 checks passed
DN6 pushed a commit that referenced this pull request Jul 1, 2026
Adds a pixel-space variant of PRX that denoises raw RGB directly
(no VAE), conditioned on a Qwen3-VL text encoder:

- PRXTransformer2DModel: new optional config args `bottleneck_size`
  (two-layer img_in projection for large patch dims) and
  `resolution_embeds` (PRXResolutionEmbedder conditions the timestep
  modulation on the latent resolution)
- PRXPipeline: support for subclass-tuned tokenizer max length, light
  text cleaning, x-prediction flow matching (x0 -> velocity conversion),
  and non-unit initial noise scale
- PRXPixelPipeline: thin subclass wiring the above together
  (vae optional/None, vae_scale_factor=1, 1024px default)
- conversion script support for the pixel checkpoint format
- registration in __init__ files + dummy objects, docs autodoc entry,
  fast pipeline tests

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
@DavidBert DavidBert mentioned this pull request Sep 1, 2026
9 of 10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation models pipelines size/L PR with diff > 200 LOC tests utils

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants