feat(ui): make prompt not required

- also change the placeholder text
This commit is contained in:
psychedelicious 2023-06-07 16:12:05 +10:00
parent 7d74cbe29c
commit 844058c0a5
5 changed files with 8 additions and 24 deletions

View File

@ -506,8 +506,8 @@
"isScheduled": "Canceling",
"setType": "Set cancel type"
},
"promptPlaceholder": "Type prompt here. [negative tokens], (upweight)++, (downweight)--, swap and blend are available (see docs)",
"negativePrompts": "Negative Prompts",
"positivePromptPlaceholder": "Positive Prompt",
"negativePromptPlaceholder": "Negative Prompt",
"sendTo": "Send to",
"sendToImg2Img": "Send to Image to Image",
"sendToUnifiedCanvas": "Send To Unified Canvas",

View File

@ -9,25 +9,14 @@ import { activeTabNameSelector } from 'features/ui/store/uiSelectors';
const readinessSelector = createSelector(
[generationSelector, systemSelector, activeTabNameSelector],
(generation, system, activeTabName) => {
const {
positivePrompt: prompt,
shouldGenerateVariations,
seedWeights,
initialImage,
seed,
} = generation;
const { shouldGenerateVariations, seedWeights, initialImage, seed } =
generation;
const { isProcessing, isConnected } = system;
let isReady = true;
const reasonsWhyNotReady: string[] = [];
// Cannot generate without a prompt
if (!prompt || Boolean(prompt.match(/^[\s\r\n]+$/))) {
isReady = false;
reasonsWhyNotReady.push('Missing prompt');
}
if (activeTabName === 'img2img' && !initialImage) {
isReady = false;
reasonsWhyNotReady.push('No initial image selected');

View File

@ -20,10 +20,7 @@ const ParamNegativeConditioning = () => {
name="negativePrompt"
value={negativePrompt}
onChange={(e) => dispatch(setNegativePrompt(e.target.value))}
placeholder={t('parameters.negativePrompts')}
_focusVisible={{
borderColor: 'error.600',
}}
placeholder={t('parameters.negativePromptPlaceholder')}
fontSize="sm"
minH={16}
/>

View File

@ -70,13 +70,11 @@ const ParamPositiveConditioning = () => {
return (
<Box>
<FormControl
isInvalid={prompt.length === 0 || Boolean(prompt.match(/^[\s\r\n]+$/))}
>
<FormControl>
<IAITextarea
id="prompt"
name="prompt"
placeholder={t('parameters.promptPlaceholder')}
placeholder={t('parameters.positivePromptPlaceholder')}
value={prompt}
onChange={handleChangePrompt}
onKeyDown={handleKeyDown}

View File

@ -35,6 +35,6 @@ export const getInputOutlineStyles = (_props?: StyleFunctionProps) => ({
},
},
_placeholder: {
color: 'base.400',
color: 'base.500',
},
});