Add UNet for Latent Diffusion#5
Merged
Merged
Conversation
williamberman
pushed a commit
to williamberman/diffusers
that referenced
this pull request
Sep 18, 2023
Fix code quality
yiyixuxu
pushed a commit
that referenced
this pull request
Jan 21, 2024
update for code quality check
5 tasks
yuyanpeng-google
pushed a commit
to yuyanpeng-google/diffusers
that referenced
this pull request
Oct 30, 2025
use op override and adjust block size to 2048
sayakpaul
pushed a commit
that referenced
this pull request
Jan 13, 2026
yiyixuxu
added a commit
that referenced
this pull request
Apr 27, 2026
[agents docs] restructure modular.md: standalone reusability + IO-respect patterns Distilled from the ErnieImage modular pipeline review (PR #13498): - New "Common modular conventions" section: skim qwenimage / flux2 / wan / helios first, mirroring the references-driven shape of models.md / pipelines.md. - Promoted "Standalone block reusability" to a Key pattern. Each block (text encoder, VAE encoder, prepare-latents, denoise, decoder) must run on its own; encoders take raw inputs only, per-prompt expansion happens in a dedicated input step inside the core denoise sequence. Replaces old gotchas #4 (pre-computed encoder outputs) and #5 (VAE encode in prepare-latents). - Promoted "Flat block assembly" to a Key pattern (was gotcha #7). - New gotcha "Respect the declared IO system": one rule covering three bypass directions — defensive `getattr` reads of declared components/state, undeclared `block_state` writes, and direct `state.set()` calls that skip `set_block_state` entirely. - Reworked InputParam/OutputParam section to link to INPUT_PARAM_TEMPLATES / OUTPUT_PARAM_TEMPLATES in modular_pipeline_utils.py (the registry is dynamic) and added a non-template example. - Added a distilled-checkpoint exception to the `guidance_scale`-as-input gotcha — distilled flux-style models legitimately accept it. - Dropped the "inputs duplicating derivable state" gotcha (uncommon). Co-authored-by: yiyi@huggingface.co <yiyi@ip-26-0-160-103.ec2.internal> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 tasks
terarachang
pushed a commit
to terarachang/diffusers
that referenced
this pull request
Apr 30, 2026
[agents docs] restructure modular.md: standalone reusability + IO-respect patterns Distilled from the ErnieImage modular pipeline review (PR huggingface#13498): - New "Common modular conventions" section: skim qwenimage / flux2 / wan / helios first, mirroring the references-driven shape of models.md / pipelines.md. - Promoted "Standalone block reusability" to a Key pattern. Each block (text encoder, VAE encoder, prepare-latents, denoise, decoder) must run on its own; encoders take raw inputs only, per-prompt expansion happens in a dedicated input step inside the core denoise sequence. Replaces old gotchas huggingface#4 (pre-computed encoder outputs) and huggingface#5 (VAE encode in prepare-latents). - Promoted "Flat block assembly" to a Key pattern (was gotcha huggingface#7). - New gotcha "Respect the declared IO system": one rule covering three bypass directions — defensive `getattr` reads of declared components/state, undeclared `block_state` writes, and direct `state.set()` calls that skip `set_block_state` entirely. - Reworked InputParam/OutputParam section to link to INPUT_PARAM_TEMPLATES / OUTPUT_PARAM_TEMPLATES in modular_pipeline_utils.py (the registry is dynamic) and added a non-template example. - Added a distilled-checkpoint exception to the `guidance_scale`-as-input gotcha — distilled flux-style models legitimately accept it. - Dropped the "inputs duplicating derivable state" gotcha (uncommon). Co-authored-by: yiyi@huggingface.co <yiyi@ip-26-0-160-103.ec2.internal> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ghostxsl
pushed a commit
to ghostxsl/diffusers
that referenced
this pull request
May 6, 2026
[agents docs] restructure modular.md: standalone reusability + IO-respect patterns Distilled from the ErnieImage modular pipeline review (PR huggingface#13498): - New "Common modular conventions" section: skim qwenimage / flux2 / wan / helios first, mirroring the references-driven shape of models.md / pipelines.md. - Promoted "Standalone block reusability" to a Key pattern. Each block (text encoder, VAE encoder, prepare-latents, denoise, decoder) must run on its own; encoders take raw inputs only, per-prompt expansion happens in a dedicated input step inside the core denoise sequence. Replaces old gotchas huggingface#4 (pre-computed encoder outputs) and huggingface#5 (VAE encode in prepare-latents). - Promoted "Flat block assembly" to a Key pattern (was gotcha huggingface#7). - New gotcha "Respect the declared IO system": one rule covering three bypass directions — defensive `getattr` reads of declared components/state, undeclared `block_state` writes, and direct `state.set()` calls that skip `set_block_state` entirely. - Reworked InputParam/OutputParam section to link to INPUT_PARAM_TEMPLATES / OUTPUT_PARAM_TEMPLATES in modular_pipeline_utils.py (the registry is dynamic) and added a non-template example. - Added a distilled-checkpoint exception to the `guidance_scale`-as-input gotcha — distilled flux-style models legitimately accept it. - Dropped the "inputs duplicating derivable state" gotcha (uncommon). Co-authored-by: yiyi@huggingface.co <yiyi@ip-26-0-160-103.ec2.internal> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 21, 2026
Enderfga
added a commit
to Enderfga/diffusers
that referenced
this pull request
May 21, 2026
Finding huggingface#1 — attention_kwargs plumbing: Both transformers now decorate forward() with @apply_lora_scale('attention_kwargs') (matches Wan); pipelines forward attention_kwargs to the transformer + encode_kv_cache, and the unused parameter is dropped from the inner _forward_train / _forward_cache / _forward_inference signatures. Pipeline docstrings updated to the standard wording. Finding huggingface#2 — naming: Rename far_cfg -> layout_cfg in the bidi transformer (the bidi path is not FAR; the FAR transformer keeps far_cfg, which is accurate there). Finding huggingface#3 — scheduler state machine: Add _step_index, _begin_index, step_index property, begin_index property, set_begin_index(), _init_step_index(). step() lazily initializes and advances the counter so downstream callbacks / composable schedulers can observe rollout progress. Sigma resolution remains a pure function of (timestep, r_timestep) — calling step() twice with identical args still returns identical prev_sample (idempotent). Finding huggingface#4 — redundant @torch.no_grad(): Drop the redundant decorators on bidi pipeline's encode_video and FAR pipeline's encode_kv_cache (callers are already in __call__'s no-grad scope). Finding huggingface#5 — dead code: Remove the unreachable temb.ndim == 2 else branch from the bidi transformer's output-norm path (condition_embedder.forward always returns a 3D temb). Finding huggingface#6 — private rename: forward_far_patchify[_inference] -> _forward_far_patchify[_inference] (only called internally by _forward_train / _forward_cache / _forward_inference). Finding huggingface#7 — pipeline comment numbering: Bidi + FAR pipelines renumber steps so the # 4. slot is no longer skipped. Finding huggingface#8 — mask-mod comment numbering: _build_causal_mask numbered comments now run 1) 2) 3) ... (was 1) 3) 4) ...). Tests: - New test_step_index_advances + test_set_begin_index_anchors_step_index in the scheduler test file exercise the new state machine. - All existing pipeline / transformer / scheduler tests still pass (85 passed, 85 skipped on CPU). Bit-exact: 8-step rollout vs the previous formulation, max abs diff = 0.0 (the new sigma-lookup is byte-identical to t/num_train_timesteps on this schedule).
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.
No description provided.