Fix LayerSkipConfig shorthand crash in SkipLayerGuidance and AutoGuidance#10
Draft
cursor[bot] wants to merge 1 commit into
Draft
Fix LayerSkipConfig shorthand crash in SkipLayerGuidance and AutoGuidance#10cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
When SkipLayerGuidance or AutoGuidance build LayerSkipConfig from layer index shorthand, pass indices=[layer] instead of a bare int. The int was stored in indices and crashed hook installation with TypeError. Also invoke ruff via python -m in check_copies so the copy checker runs when ruff is not on PATH. Co-authored-by: Simon Lynch <srlynch1@users.noreply.github.com>
This was referenced Jun 24, 2026
Draft
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
Fixes a crash when using the documented
skip_layer_guidance_layers/auto_guidance_layersshorthand onSkipLayerGuidanceandAutoGuidance.Bug and impact
Using the shorthand layer list (e.g.
skip_layer_guidance_layers=[7, 8, 9]for SD3.5-style Skip Layer Guidance) crashes during hook installation withTypeError: object of type 'int' has no len(). Skip Layer Guidance and AutoGuidance are completely broken for the primary documented API path.Root cause
LayerSkipConfig(layer, fqn="auto")passes the layer index as the first positional argument, which maps toindices— butindicesmust belist[int]. The bare int breaks membership checks andlen()calls inside_apply_layer_skip_hook.Fix
Pass
indices=[layer]when building configs from shorthand in both guiders. Added regression tests intests/guiders/test_skip_layer_guidance.py.Validation
pytest tests/guiders/test_skip_layer_guidance.py— 2 passedSkipLayerGuidance.prepare_models()with shorthand layersNotes
check_copies.pychange: invoke ruff viapython -m ruffso copy checking works whenruffis not on PATH.