feat(ui): hide clipskip on sdxl; do not add to metadata (#4625)

Hide it until #4624 is ready

## What type of PR is this? (check all applicable)

- [ ] Refactor
- [ ] Feature
- [x] Bug Fix
- [ ] Optimization
- [ ] Documentation Update
- [ ] Community Node Submission



## Description

feat(ui): hide clipskip on sdxl; do not add to metadata
Hide it until #4624 is ready

## Related Tickets & Documents

<!--
For pull requests that relate or close an issue, please include them
below. 

For example having the text: "closes #1234" would connect the current
pull
request to issue 1234.  And when we merge the pull request, Github will
automatically close the issue.
-->

- Closes #4618
This commit is contained in:
blessedcoolant 2023-09-21 09:44:13 +05:30 committed by GitHub
commit d3a2be69f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 15 deletions

View File

@ -45,7 +45,6 @@ export const buildCanvasSDXLImageToImageGraph = (
seed, seed,
steps, steps,
vaePrecision, vaePrecision,
clipSkip,
shouldUseCpuNoise, shouldUseCpuNoise,
seamlessXAxis, seamlessXAxis,
seamlessYAxis, seamlessYAxis,
@ -339,7 +338,6 @@ export const buildCanvasSDXLImageToImageGraph = (
vae: undefined, // option; set in addVAEToGraph vae: undefined, // option; set in addVAEToGraph
controlnets: [], // populated in addControlNetToLinearGraph controlnets: [], // populated in addControlNetToLinearGraph
loras: [], // populated in addLoRAsToGraph loras: [], // populated in addLoRAsToGraph
clip_skip: clipSkip,
strength, strength,
init_image: initialImage.image_name, init_image: initialImage.image_name,
}; };

View File

@ -46,7 +46,6 @@ export const buildCanvasSDXLTextToImageGraph = (
seed, seed,
steps, steps,
vaePrecision, vaePrecision,
clipSkip,
shouldUseCpuNoise, shouldUseCpuNoise,
seamlessXAxis, seamlessXAxis,
seamlessYAxis, seamlessYAxis,
@ -321,7 +320,6 @@ export const buildCanvasSDXLTextToImageGraph = (
vae: undefined, // option; set in addVAEToGraph vae: undefined, // option; set in addVAEToGraph
controlnets: [], // populated in addControlNetToLinearGraph controlnets: [], // populated in addControlNetToLinearGraph
loras: [], // populated in addLoRAsToGraph loras: [], // populated in addLoRAsToGraph
clip_skip: clipSkip,
}; };
graph.edges.push({ graph.edges.push({

View File

@ -49,7 +49,6 @@ export const buildLinearSDXLImageToImageGraph = (
shouldFitToWidthHeight, shouldFitToWidthHeight,
width, width,
height, height,
clipSkip,
shouldUseCpuNoise, shouldUseCpuNoise,
vaePrecision, vaePrecision,
seamlessXAxis, seamlessXAxis,
@ -349,7 +348,6 @@ export const buildLinearSDXLImageToImageGraph = (
vae: undefined, vae: undefined,
controlnets: [], controlnets: [],
loras: [], loras: [],
clip_skip: clipSkip,
strength: strength, strength: strength,
init_image: initialImage.imageName, init_image: initialImage.imageName,
positive_style_prompt: positiveStylePrompt, positive_style_prompt: positiveStylePrompt,

View File

@ -38,7 +38,6 @@ export const buildLinearSDXLTextToImageGraph = (
steps, steps,
width, width,
height, height,
clipSkip,
shouldUseCpuNoise, shouldUseCpuNoise,
vaePrecision, vaePrecision,
seamlessXAxis, seamlessXAxis,
@ -243,7 +242,6 @@ export const buildLinearSDXLTextToImageGraph = (
vae: undefined, vae: undefined,
controlnets: [], controlnets: [],
loras: [], loras: [],
clip_skip: clipSkip,
positive_style_prompt: positiveStylePrompt, positive_style_prompt: positiveStylePrompt,
negative_style_prompt: negativeStylePrompt, negative_style_prompt: negativeStylePrompt,
}; };

View File

@ -13,16 +13,16 @@ import ParamClipSkip from './ParamClipSkip';
const selector = createSelector( const selector = createSelector(
stateSelector, stateSelector,
(state: RootState) => { (state: RootState) => {
const { clipSkip, seamlessXAxis, seamlessYAxis, shouldUseCpuNoise } = const { clipSkip, model, seamlessXAxis, seamlessYAxis, shouldUseCpuNoise } =
state.generation; state.generation;
return { clipSkip, seamlessXAxis, seamlessYAxis, shouldUseCpuNoise }; return { clipSkip, model, seamlessXAxis, seamlessYAxis, shouldUseCpuNoise };
}, },
defaultSelectorOptions defaultSelectorOptions
); );
export default function ParamAdvancedCollapse() { export default function ParamAdvancedCollapse() {
const { clipSkip, seamlessXAxis, seamlessYAxis, shouldUseCpuNoise } = const { clipSkip, model, seamlessXAxis, seamlessYAxis, shouldUseCpuNoise } =
useAppSelector(selector); useAppSelector(selector);
const { t } = useTranslation(); const { t } = useTranslation();
const activeLabel = useMemo(() => { const activeLabel = useMemo(() => {
@ -34,7 +34,7 @@ export default function ParamAdvancedCollapse() {
activeLabel.push(t('parameters.gpuNoise')); activeLabel.push(t('parameters.gpuNoise'));
} }
if (clipSkip > 0) { if (clipSkip > 0 && model && model.base_model !== 'sdxl') {
activeLabel.push( activeLabel.push(
t('parameters.clipSkipWithLayerCount', { layerCount: clipSkip }) t('parameters.clipSkipWithLayerCount', { layerCount: clipSkip })
); );
@ -49,15 +49,19 @@ export default function ParamAdvancedCollapse() {
} }
return activeLabel.join(', '); return activeLabel.join(', ');
}, [clipSkip, seamlessXAxis, seamlessYAxis, shouldUseCpuNoise, t]); }, [clipSkip, model, seamlessXAxis, seamlessYAxis, shouldUseCpuNoise, t]);
return ( return (
<IAICollapse label={t('common.advanced')} activeLabel={activeLabel}> <IAICollapse label={t('common.advanced')} activeLabel={activeLabel}>
<Flex sx={{ flexDir: 'column', gap: 2 }}> <Flex sx={{ flexDir: 'column', gap: 2 }}>
<ParamSeamless /> <ParamSeamless />
<Divider /> <Divider />
{model && model?.base_model !== 'sdxl' && (
<>
<ParamClipSkip /> <ParamClipSkip />
<Divider pt={2} /> <Divider pt={2} />
</>
)}
<ParamCpuNoiseToggle /> <ParamCpuNoiseToggle />
</Flex> </Flex>
</IAICollapse> </IAICollapse>

View File

@ -42,6 +42,10 @@ export default function ParamClipSkip() {
return clipSkipMap[model.base_model].markers; return clipSkipMap[model.base_model].markers;
}, [model]); }, [model]);
if (model?.base_model === 'sdxl') {
return null;
}
return ( return (
<IAIInformationalPopover details="clipSkip"> <IAIInformationalPopover details="clipSkip">
<IAISlider <IAISlider