Skip to content

fix(sampling): fix image resize variable in simple_video_sample (#469) - #497

Open
themanoj-025 wants to merge 1 commit into
Stability-AI:mainfrom
themanoj-025:fix/resize-variable-simple-video-sample
Open

themanoj-025 wants to merge 1 commit into
Stability-AI:mainfrom
themanoj-025:fix/resize-variable-simple-video-sample

Conversation

@themanoj-025

Copy link
Copy Markdown

Summary

Fixes #469

In scripts/sampling/simple_video_sample.py, when an input image has height or width that is not divisible by 64, line 171 attempted to resize input_image:

input_image = input_image.resize((width, height))

However, at line 171 input_image was not yet defined (it was defined on line 175 from image), causing a NameError: name 'input_image' is not defined (or UnboundLocalError). Furthermore, even if defined, line 175 would overwrite input_image = np.array(image) without the resize.

This PR fixes the resize call to target image directly:

image = image.resize((width, height))

which matches the pattern already used in scripts/demo/gradio_app.py:125.

Verification

  • Verified on a non-64-divisible image (e.g. 500x700):
    • Before fix: raised NameError: name 'input_image' is not defined
    • After fix: resized properly to 448x640 (both divisible by 64) and converted to numpy array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: wrong variable name in scripts/sampling/simple_video_sample.py

1 participant