mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): use max prompts for combinatorial, iterations for non-combi… (#3600)
…natorial
This commit is contained in:
commit
00c78b1cbc
@ -35,8 +35,8 @@ const ParamDynamicPromptsCollapse = () => {
|
||||
withSwitch
|
||||
>
|
||||
<Flex sx={{ gap: 2, flexDir: 'column' }}>
|
||||
<ParamDynamicPromptsMaxPrompts />
|
||||
<ParamDynamicPromptsCombinatorial />
|
||||
<ParamDynamicPromptsMaxPrompts />
|
||||
</Flex>
|
||||
</IAICollapse>
|
||||
);
|
||||
|
@ -9,17 +9,18 @@ import { stateSelector } from 'app/store/store';
|
||||
const selector = createSelector(
|
||||
stateSelector,
|
||||
(state) => {
|
||||
const { maxPrompts } = state.dynamicPrompts;
|
||||
const { maxPrompts, combinatorial } = state.dynamicPrompts;
|
||||
const { min, sliderMax, inputMax } =
|
||||
state.config.sd.dynamicPrompts.maxPrompts;
|
||||
|
||||
return { maxPrompts, min, sliderMax, inputMax };
|
||||
return { maxPrompts, min, sliderMax, inputMax, combinatorial };
|
||||
},
|
||||
defaultSelectorOptions
|
||||
);
|
||||
|
||||
const ParamDynamicPromptsMaxPrompts = () => {
|
||||
const { maxPrompts, min, sliderMax, inputMax } = useAppSelector(selector);
|
||||
const { maxPrompts, min, sliderMax, inputMax, combinatorial } =
|
||||
useAppSelector(selector);
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
const handleChange = useCallback(
|
||||
@ -36,6 +37,7 @@ const ParamDynamicPromptsMaxPrompts = () => {
|
||||
return (
|
||||
<IAISlider
|
||||
label="Max Prompts"
|
||||
isDisabled={!combinatorial}
|
||||
min={min}
|
||||
max={sliderMax}
|
||||
value={maxPrompts}
|
||||
|
@ -37,7 +37,7 @@ export const addDynamicPromptsToGraph = (
|
||||
const dynamicPromptNode: DynamicPromptInvocation = {
|
||||
id: DYNAMIC_PROMPT,
|
||||
type: 'dynamic_prompt',
|
||||
max_prompts: maxPrompts,
|
||||
max_prompts: combinatorial ? maxPrompts : iterations,
|
||||
combinatorial,
|
||||
prompt: positivePrompt,
|
||||
};
|
||||
|
@ -16,7 +16,8 @@ const selector = createSelector([stateSelector], (state) => {
|
||||
state.config.sd.iterations;
|
||||
const { iterations } = state.generation;
|
||||
const { shouldUseSliders } = state.ui;
|
||||
const isDisabled = state.dynamicPrompts.isEnabled;
|
||||
const isDisabled =
|
||||
state.dynamicPrompts.isEnabled && state.dynamicPrompts.combinatorial;
|
||||
|
||||
const step = state.hotkeys.shift ? fineStep : coarseStep;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user