mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
chore(ui): clean up generationSlice
This commit is contained in:
parent
f9e78d3c64
commit
b6f5267385
@ -11,9 +11,8 @@ export interface GenerationState {
|
|||||||
height: number;
|
height: number;
|
||||||
img2imgStrength: number;
|
img2imgStrength: number;
|
||||||
infillMethod: string;
|
infillMethod: string;
|
||||||
initialImage?: InvokeAI.Image; // can be an Image or url
|
initialImage?: InvokeAI.Image;
|
||||||
iterations: number;
|
iterations: number;
|
||||||
maskPath: string;
|
|
||||||
perlin: number;
|
perlin: number;
|
||||||
prompt: string;
|
prompt: string;
|
||||||
negativePrompt: string;
|
negativePrompt: string;
|
||||||
@ -48,7 +47,6 @@ export const initialGenerationState: GenerationState = {
|
|||||||
img2imgStrength: 0.75,
|
img2imgStrength: 0.75,
|
||||||
infillMethod: 'patchmatch',
|
infillMethod: 'patchmatch',
|
||||||
iterations: 1,
|
iterations: 1,
|
||||||
maskPath: '',
|
|
||||||
perlin: 0,
|
perlin: 0,
|
||||||
prompt: '',
|
prompt: '',
|
||||||
negativePrompt: '',
|
negativePrompt: '',
|
||||||
@ -145,9 +143,6 @@ export const generationSlice = createSlice({
|
|||||||
setImg2imgStrength: (state, action: PayloadAction<number>) => {
|
setImg2imgStrength: (state, action: PayloadAction<number>) => {
|
||||||
state.img2imgStrength = action.payload;
|
state.img2imgStrength = action.payload;
|
||||||
},
|
},
|
||||||
setMaskPath: (state, action: PayloadAction<string>) => {
|
|
||||||
state.maskPath = action.payload;
|
|
||||||
},
|
|
||||||
setSeamless: (state, action: PayloadAction<boolean>) => {
|
setSeamless: (state, action: PayloadAction<boolean>) => {
|
||||||
state.shouldUseSeamless = action.payload;
|
state.shouldUseSeamless = action.payload;
|
||||||
},
|
},
|
||||||
@ -163,19 +158,6 @@ export const generationSlice = createSlice({
|
|||||||
resetSeed: (state) => {
|
resetSeed: (state) => {
|
||||||
state.seed = -1;
|
state.seed = -1;
|
||||||
},
|
},
|
||||||
setParameter: (
|
|
||||||
state,
|
|
||||||
action: PayloadAction<{ key: string; value: string | number | boolean }>
|
|
||||||
) => {
|
|
||||||
// TODO: This probably needs to be refactored.
|
|
||||||
// TODO: This probably also needs to be fixed after the reorg.
|
|
||||||
const { key, value } = action.payload;
|
|
||||||
const temp = { ...state, [key]: value };
|
|
||||||
if (key === 'seed') {
|
|
||||||
temp.shouldRandomizeSeed = false;
|
|
||||||
}
|
|
||||||
return temp;
|
|
||||||
},
|
|
||||||
setShouldGenerateVariations: (state, action: PayloadAction<boolean>) => {
|
setShouldGenerateVariations: (state, action: PayloadAction<boolean>) => {
|
||||||
state.shouldGenerateVariations = action.payload;
|
state.shouldGenerateVariations = action.payload;
|
||||||
},
|
},
|
||||||
@ -258,10 +240,7 @@ export const {
|
|||||||
setHeight,
|
setHeight,
|
||||||
setImg2imgStrength,
|
setImg2imgStrength,
|
||||||
setInfillMethod,
|
setInfillMethod,
|
||||||
// setInitialImage,
|
|
||||||
setIterations,
|
setIterations,
|
||||||
setMaskPath,
|
|
||||||
setParameter,
|
|
||||||
setPerlin,
|
setPerlin,
|
||||||
setPrompt,
|
setPrompt,
|
||||||
setNegativePrompt,
|
setNegativePrompt,
|
||||||
|
Loading…
Reference in New Issue
Block a user