Skip to content

resize initial image to match requested width and height#214

Merged
lstein merged 1 commit intomainfrom
feature-resize-init-img
Aug 30, 2022
Merged

resize initial image to match requested width and height#214
lstein merged 1 commit intomainfrom
feature-resize-init-img

Conversation

@lstein
Copy link
Collaborator

@lstein lstein commented Aug 30, 2022

If the aspect ratio of the initial image doesn't match destination aspect ratio, then the initial image is letterboxed as appropriate. All dimensions are clipped to multiples of 64.
Closes #210. Closes #207

@lstein lstein self-assigned this Aug 30, 2022
Copy link
Collaborator

@blessedcoolant blessedcoolant left a comment

Choose a reason for hiding this comment

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

Tried out a few test cases. Provided a 550x550 image.

  • When no prompts are passed, it resizes it correctly to 512x512
  • When W or H are passed to 600, it resizes it correctly to 576
  • Black boxing is being applied correctly too.

Seems to be working as described.

@lstein lstein merged commit a51e18e into main Aug 30, 2022
@lstein lstein deleted the feature-resize-init-img branch August 30, 2022 19:26
@n00mkrad
Copy link

The current code does NOT resize the init image to fit within the specified -W and -H, it only seems to do mod64.

austinbrown34 pushed a commit to cognidesign/InvokeAI that referenced this pull request Dec 30, 2022
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.

img2img resizes to mod32, however mod64 is required img2img should resize init image to -W and -H values when specified

4 participants