mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): migrate linear workflows to latents
This commit is contained in:
committed by
Kent Keirsey
parent
d2c223de8f
commit
c7c0836721
@ -8,7 +8,7 @@ import { readinessSelector } from 'app/selectors/readinessSelector';
|
||||
import {
|
||||
GenerationState,
|
||||
clampSymmetrySteps,
|
||||
setPrompt,
|
||||
setPositivePrompt,
|
||||
} from 'features/parameters/store/generationSlice';
|
||||
import { activeTabNameSelector } from 'features/ui/store/uiSelectors';
|
||||
|
||||
@ -22,7 +22,7 @@ const promptInputSelector = createSelector(
|
||||
[(state: RootState) => state.generation, activeTabNameSelector],
|
||||
(parameters: GenerationState, activeTabName) => {
|
||||
return {
|
||||
prompt: parameters.prompt,
|
||||
prompt: parameters.positivePrompt,
|
||||
activeTabName,
|
||||
};
|
||||
},
|
||||
@ -46,7 +46,7 @@ const ParamPositiveConditioning = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const handleChangePrompt = (e: ChangeEvent<HTMLTextAreaElement>) => {
|
||||
dispatch(setPrompt(e.target.value));
|
||||
dispatch(setPositivePrompt(e.target.value));
|
||||
};
|
||||
|
||||
useHotkeys(
|
||||
|
@ -57,7 +57,7 @@ const InitialImagePreview = () => {
|
||||
const name = e.dataTransfer.getData('invokeai/imageName');
|
||||
const type = e.dataTransfer.getData('invokeai/imageType') as ImageType;
|
||||
|
||||
dispatch(initialImageSelected({ name, type }));
|
||||
dispatch(initialImageSelected({ image_name: name, image_type: type }));
|
||||
},
|
||||
[dispatch]
|
||||
);
|
||||
@ -73,10 +73,10 @@ const InitialImagePreview = () => {
|
||||
}}
|
||||
onDrop={handleDrop}
|
||||
>
|
||||
{initialImage?.url && (
|
||||
{initialImage?.image_url && (
|
||||
<>
|
||||
<Image
|
||||
src={getUrl(initialImage?.url)}
|
||||
src={getUrl(initialImage?.image_url)}
|
||||
fallbackStrategy="beforeLoadOrError"
|
||||
fallback={<ImageFallbackSpinner />}
|
||||
onError={handleError}
|
||||
@ -92,7 +92,7 @@ const InitialImagePreview = () => {
|
||||
<ImageMetadataOverlay image={initialImage} />
|
||||
</>
|
||||
)}
|
||||
{!initialImage?.url && (
|
||||
{!initialImage?.image_url && (
|
||||
<Icon
|
||||
as={FaImage}
|
||||
sx={{
|
||||
|
@ -3,7 +3,7 @@ import { getPromptAndNegative } from 'common/util/getPromptAndNegative';
|
||||
import * as InvokeAI from 'app/types/invokeai';
|
||||
import promptToString from 'common/util/promptToString';
|
||||
import { useAppDispatch } from 'app/store/storeHooks';
|
||||
import { setNegativePrompt, setPrompt } from '../store/generationSlice';
|
||||
import { setNegativePrompt, setPositivePrompt } from '../store/generationSlice';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
// TECHDEBT: We have two metadata prompt formats and need to handle recalling either of them.
|
||||
@ -20,7 +20,7 @@ const useSetBothPrompts = () => {
|
||||
|
||||
const [prompt, negativePrompt] = getPromptAndNegative(promptString);
|
||||
|
||||
dispatch(setPrompt(prompt));
|
||||
dispatch(setPositivePrompt(prompt));
|
||||
dispatch(setNegativePrompt(negativePrompt));
|
||||
},
|
||||
[dispatch]
|
||||
|
@ -16,7 +16,7 @@ export interface GenerationState {
|
||||
initialImage?: ImageDTO;
|
||||
iterations: number;
|
||||
perlin: number;
|
||||
prompt: string;
|
||||
positivePrompt: string;
|
||||
negativePrompt: string;
|
||||
scheduler: Scheduler;
|
||||
seamBlur: number;
|
||||
@ -50,7 +50,7 @@ export const initialGenerationState: GenerationState = {
|
||||
infillMethod: 'patchmatch',
|
||||
iterations: 1,
|
||||
perlin: 0,
|
||||
prompt: '',
|
||||
positivePrompt: '',
|
||||
negativePrompt: '',
|
||||
scheduler: 'lms',
|
||||
seamBlur: 16,
|
||||
@ -83,12 +83,15 @@ export const generationSlice = createSlice({
|
||||
name: 'generation',
|
||||
initialState,
|
||||
reducers: {
|
||||
setPrompt: (state, action: PayloadAction<string | InvokeAI.Prompt>) => {
|
||||
setPositivePrompt: (
|
||||
state,
|
||||
action: PayloadAction<string | InvokeAI.Prompt>
|
||||
) => {
|
||||
const newPrompt = action.payload;
|
||||
if (typeof newPrompt === 'string') {
|
||||
state.prompt = newPrompt;
|
||||
state.positivePrompt = newPrompt;
|
||||
} else {
|
||||
state.prompt = promptToString(newPrompt);
|
||||
state.positivePrompt = promptToString(newPrompt);
|
||||
}
|
||||
},
|
||||
setNegativePrompt: (
|
||||
@ -244,7 +247,7 @@ export const {
|
||||
setInfillMethod,
|
||||
setIterations,
|
||||
setPerlin,
|
||||
setPrompt,
|
||||
setPositivePrompt,
|
||||
setNegativePrompt,
|
||||
setScheduler,
|
||||
setSeamBlur,
|
||||
|
@ -31,7 +31,7 @@ export const setAllParametersReducer = (
|
||||
state.model = String(model);
|
||||
}
|
||||
if (prompt !== undefined) {
|
||||
state.prompt = String(prompt);
|
||||
state.positivePrompt = String(prompt);
|
||||
}
|
||||
if (scheduler !== undefined) {
|
||||
const schedulerString = String(scheduler);
|
||||
|
Reference in New Issue
Block a user