Skip to content

fix(ui): mask logic in graph builders #7828

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ export const addFLUXFill = async ({

const fluxFill = g.addNode({ type: 'flux_fill', id: getPrefixedId('flux_fill') });

if (!isEqual(scaledSize, originalSize)) {
const needsScaleBeforeProcessing = !isEqual(scaledSize, originalSize);

if (needsScaleBeforeProcessing) {
// Scale before processing requires some resizing

// Combine the inpaint mask and the initial image's alpha channel into a single mask
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ export const addInpaint = async ({
silent: true,
});

if (!isEqual(scaledSize, originalSize)) {
const needsScaleBeforeProcessing = !isEqual(scaledSize, originalSize);

if (needsScaleBeforeProcessing) {
// Scale before processing requires some resizing
const i2l = g.addNode({
id: i2lNodeType,
Expand Down Expand Up @@ -127,8 +129,8 @@ export const addInpaint = async ({

// After denoising, resize the image and mask back to original size
g.addEdge(l2i, 'image', resizeImageToOriginalSize, 'image');
g.addEdge(createGradientMask, 'expanded_mask_area', resizeMaskToOriginalSize, 'image');
g.addEdge(createGradientMask, 'expanded_mask_area', expandMask, 'mask');
g.addEdge(expandMask, 'image', resizeMaskToOriginalSize, 'image');

// After denoising, resize the image and mask back to original size
// Do the paste back if we are sending to gallery (in which case we want to see the full image), or if we are sending
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ export const addOutpaint = async ({

const infill = getInfill(g, params);

if (!isEqual(scaledSize, originalSize)) {
const needsScaleBeforeProcessing = !isEqual(scaledSize, originalSize);

if (needsScaleBeforeProcessing) {
// Scale before processing requires some resizing

// Combine the inpaint mask and the initial image's alpha channel into a single mask
Expand Down