invoke-ai / InvokeAI

Invoke is a leading creative engine for Stable Diffusion models, empowering professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry leading WebUI, and serves as the foundation for multiple commercial products.
https://invoke-ai.github.io/InvokeAI/
Apache License 2.0
23.77k stars 2.44k forks source link

fix(ui): fit bbox to layers math #7297

Closed psychedelicious closed 2 weeks ago

psychedelicious commented 2 weeks ago

Summary

The math used to fit the bbox to layers was a bit off and could result in a bbox that was slightly too large.

Related Issues / Discussions

Issue that prompted me to review the logic: https://discord.com/channels/1020123559063990373/1020123559831539744/1304232644338384927

QA Instructions

The fit bbox to layers button should always result in the bbox being the same size as the composite of all raster layers, or smaller. The issue affects layers whose size is not already a multiple of the grid size (8px or 16px depending on model).

This image triggers the issue when it is the only layer - could test with it. image

Checklist