mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): set w/h to multiple of 64 on add t2i
This commit is contained in:
parent
58850ded22
commit
10fac5c085
@ -3,6 +3,7 @@ import {
|
|||||||
Update,
|
Update,
|
||||||
createEntityAdapter,
|
createEntityAdapter,
|
||||||
createSlice,
|
createSlice,
|
||||||
|
isAnyOf,
|
||||||
} from '@reduxjs/toolkit';
|
} from '@reduxjs/toolkit';
|
||||||
import {
|
import {
|
||||||
ControlNetModelParam,
|
ControlNetModelParam,
|
||||||
@ -544,3 +545,9 @@ export const {
|
|||||||
} = controlAdaptersSlice.actions;
|
} = controlAdaptersSlice.actions;
|
||||||
|
|
||||||
export default controlAdaptersSlice.reducer;
|
export default controlAdaptersSlice.reducer;
|
||||||
|
|
||||||
|
export const isAnyControlAdapterAdded = isAnyOf(
|
||||||
|
controlAdapterAdded,
|
||||||
|
controlAdapterAddedFromImage,
|
||||||
|
controlAdapterRecalled
|
||||||
|
);
|
||||||
|
@ -5,6 +5,7 @@ import { configChanged } from 'features/system/store/configSlice';
|
|||||||
import { clamp } from 'lodash-es';
|
import { clamp } from 'lodash-es';
|
||||||
import { ImageDTO } from 'services/api/types';
|
import { ImageDTO } from 'services/api/types';
|
||||||
|
|
||||||
|
import { isAnyControlAdapterAdded } from 'features/controlAdapters/store/controlAdaptersSlice';
|
||||||
import { clipSkipMap } from '../types/constants';
|
import { clipSkipMap } from '../types/constants';
|
||||||
import {
|
import {
|
||||||
CanvasCoherenceModeParam,
|
CanvasCoherenceModeParam,
|
||||||
@ -302,6 +303,15 @@ export const generationSlice = createSlice({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// TODO: This is a temp fix to reduce issues with T2I adapter having a different downscaling
|
||||||
|
// factor than the UNet. Hopefully we get an upstream fix in diffusers.
|
||||||
|
builder.addMatcher(isAnyControlAdapterAdded, (state, action) => {
|
||||||
|
if (action.payload.type === 't2i_adapter') {
|
||||||
|
state.width = roundToMultiple(state.width, 64);
|
||||||
|
state.height = roundToMultiple(state.height, 64);
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user