Skip to content

fix(metadata): recall z_image_shift correctly#9139

Open
Pfannkuchensack wants to merge 1 commit intoinvoke-ai:mainfrom
Pfannkuchensack:fix/z-image-shift-recall
Open

fix(metadata): recall z_image_shift correctly#9139
Pfannkuchensack wants to merge 1 commit intoinvoke-ai:mainfrom
Pfannkuchensack:fix/z-image-shift-recall

Conversation

@Pfannkuchensack
Copy link
Copy Markdown
Collaborator

Summary

Widen the validator range to match the param's actual max (10) so saved shift values above 3 are recalled, and handle absent/null values by recalling as auto (null) when the recalled image is a Z-Image.

Previously the parser used z.number().min(0).max(3), which silently rejected any saved shift value greater than 3 (the slider goes up to 7, the number input up to 10). It also had no path for older Z-Image images that don't include z_image_shift in their metadata, so "Use All" left the current shift untouched instead of resetting to auto.

The handler now:

  • accepts 0..10 to match ParamZImageShift's numberInputMax,
  • resolves to null when the key is null or absent and the active base is z-image (checked via selectBase, which is reliable because MainModel is sorted to recall first),
  • rejects on absent key for non-Z-Image recalls so unrelated metadata doesn't clobber the user's current shift.

Related Issues / Discussions

Closes #9135

QA Instructions

  1. Generate a Z-Image with shift > 3 (e.g. 5) → open the image in the gallery → click Use All. Expected: shift slider recalls to 5. Before this fix it stayed on whatever value was set in the UI.
  2. Generate a Z-Image with shift left at autoUse All. Expected: shift recalls to auto.
  3. Open an older Z-Image (generated before z_image_shift was added to metadata) → Use All. Expected: shift recalls to auto.
  4. While on Z-Image with a custom shift, Use All on a non-Z-Image (SDXL / FLUX / Qwen). Expected: Z-Image shift is not reset (handler rejects when base isn't z-image).
  5. Hover the metadata viewer on an image with shift = auto. Expected: value renders as Auto (was previously empty/undefined).

Merge Plan

Standard merge — no schema or migration impact, redux slice shape is unchanged (zImageShift: number | null already supports null).

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • ❗Changes to a redux slice have a corresponding migration
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

Widen the validator range to match the param's actual max (10) so saved
shift values above 3 are recalled, and handle absent/null values by
recalling as auto (null) when the recalled image is a Z-Image.
@github-actions github-actions Bot added the frontend PRs that change frontend files label May 9, 2026
@lstein lstein self-assigned this May 9, 2026
@lstein lstein added the v6.13.x label May 9, 2026
@lstein lstein moved this to 6.13.x Theme: MODELS in Invoke - Community Roadmap May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend PRs that change frontend files v6.13.x

Projects

Status: 6.13.x Theme: MODELS

Development

Successfully merging this pull request may close these issues.

[Bug]: "Z_image_shift" metadata value is saved but not recalled with "Use All"

2 participants