@@ -14,8 +14,9 @@ import WavyLine from 'common/components/WavyLine';
1414import { selectImg2imgStrength , setImg2imgStrength } from 'features/controlLayers/store/paramsSlice' ;
1515import { selectActiveRasterLayerEntities } from 'features/controlLayers/store/selectors' ;
1616import { selectImg2imgStrengthConfig } from 'features/system/store/configSlice' ;
17- import { memo , useCallback } from 'react' ;
17+ import { memo , useCallback , useMemo } from 'react' ;
1818import { useTranslation } from 'react-i18next' ;
19+ import { useSelectedModelConfig } from 'services/api/hooks/useSelectedModelConfig' ;
1920
2021const selectHasRasterLayersWithContent = createSelector (
2122 selectActiveRasterLayerEntities ,
@@ -26,6 +27,7 @@ export const ParamDenoisingStrength = memo(() => {
2627 const img2imgStrength = useAppSelector ( selectImg2imgStrength ) ;
2728 const dispatch = useAppDispatch ( ) ;
2829 const hasRasterLayersWithContent = useAppSelector ( selectHasRasterLayersWithContent ) ;
30+ const selectedModelConfig = useSelectedModelConfig ( ) ;
2931
3032 const onChange = useCallback (
3133 ( v : number ) => {
@@ -39,8 +41,24 @@ export const ParamDenoisingStrength = memo(() => {
3941
4042 const [ invokeBlue300 ] = useToken ( 'colors' , [ 'invokeBlue.300' ] ) ;
4143
44+ const isDisabled = useMemo ( ( ) => {
45+ if ( ! hasRasterLayersWithContent ) {
46+ // Denoising strength does nothing if there are no raster layers w/ content
47+ return true ;
48+ }
49+ if (
50+ selectedModelConfig ?. type === 'main' &&
51+ selectedModelConfig ?. base === 'flux' &&
52+ selectedModelConfig . variant === 'inpaint'
53+ ) {
54+ // Denoising strength is ignored by FLUX Fill, which is indicated by the variant being 'inpaint'
55+ return true ;
56+ }
57+ return false ;
58+ } , [ hasRasterLayersWithContent , selectedModelConfig ] ) ;
59+
4260 return (
43- < FormControl isDisabled = { ! hasRasterLayersWithContent } p = { 1 } justifyContent = "space-between" h = { 8 } >
61+ < FormControl isDisabled = { isDisabled } p = { 1 } justifyContent = "space-between" h = { 8 } >
4462 < Flex gap = { 3 } alignItems = "center" >
4563 < InformationalPopover feature = "paramDenoisingStrength" >
4664 < FormLabel mr = { 0 } > { `${ t ( 'parameters.denoisingStrength' ) } ` } </ FormLabel >
@@ -49,7 +67,7 @@ export const ParamDenoisingStrength = memo(() => {
4967 < WavyLine amplitude = { img2imgStrength * 10 } stroke = { invokeBlue300 } strokeWidth = { 1 } width = { 40 } height = { 14 } />
5068 ) }
5169 </ Flex >
52- { hasRasterLayersWithContent ? (
70+ { ! isDisabled ? (
5371 < >
5472 < CompositeSlider
5573 step = { config . coarseStep }
0 commit comments