Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.
TypeScript ai-artartificial-intelligencegenerative-artimage-generationimg2imginpaintinglatent-diffusionlinuxmacosoutpaintingstable-diffusiontxt2imgwindows
fix(canvas): move denoising wave beside label
joshistoast1187d7f277d7
diff --git a/invokeai/frontend/webv2/src/workbench/components/ui/Slider.tsx b/invokeai/frontend/webv2/src/workbench/components/ui/Slider.tsxindex 43cfc0a036..97de382b88 100644--- a/invokeai/frontend/webv2/src/workbench/components/ui/Slider.tsx+++ b/invokeai/frontend/webv2/src/workbench/components/ui/Slider.tsx@@ -12,8 +12,6 @@ export interface SliderProps extends Omit<ChakraSlider.RootProps, 'children'> {marks?: SliderMark[];/** Show the formatted value above each thumb while the slider is hovered or a thumb is dragged. */withThumbTooltip?: boolean;- /** Optional visual rendered behind the track and thumbs. */- trackDecoration?: ReactNode;}// Marks stay mounted so the slider keeps a stable height, but only fade in@@ -72,7 +70,6 @@ const SliderThumb = ({ index, isTooltipOpen, label }: { index: number; isTooltipexport const Slider = ({formatValue = formatValueDefault,marks,- trackDecoration,withThumbTooltip = true,...rootProps}: SliderProps) => {@@ -162,7 +159,6 @@ export const Slider = ({thumbCollisionBehavior="push"><ChakraSlider.Control>- {trackDecoration}<ChakraSlider.Track><ChakraSlider.Range /></ChakraSlider.Track>diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layers/DenoisingStrengthWave.test.ts b/invokeai/frontend/webv2/src/workbench/widgets/layers/DenoisingStrengthWave.test.tsindex 01c4a90486..ce7e285689 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/layers/DenoisingStrengthWave.test.ts+++ b/invokeai/frontend/webv2/src/workbench/widgets/layers/DenoisingStrengthWave.test.ts@@ -28,5 +28,7 @@ describe('getDenoisingStrengthWavePath', () => {expect(markup.match(/<path/g)).toHaveLength(1);expect(markup).not.toContain('stroke-dasharray');expect(markup.match(/ Q/g)).toHaveLength(5);+ expect(markup).toContain('width="56"');+ expect(markup).not.toContain('position:absolute');});});diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layers/DenoisingStrengthWave.tsx b/invokeai/frontend/webv2/src/workbench/widgets/layers/DenoisingStrengthWave.tsxindex abd588e0cf..8d928eeaac 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/layers/DenoisingStrengthWave.tsx+++ b/invokeai/frontend/webv2/src/workbench/widgets/layers/DenoisingStrengthWave.tsx@@ -37,9 +37,9 @@ export const DenoisingStrengthWave = ({ value }: { value: number }) => {aria-hiddenheight={WAVE_HEIGHT}preserveAspectRatio="none"- style={{ left: 0, pointerEvents: 'none', position: 'absolute', top: '50%', transform: 'translateY(-50%)' }}+ style={{ display: 'block', flexShrink: 0, marginLeft: 8, pointerEvents: 'none' }}viewBox={`0 0 ${WAVE_WIDTH} ${WAVE_HEIGHT}`}- width="100%"+ width={56}><pathd={path}diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layers/LayersPanelHeader.tsx b/invokeai/frontend/webv2/src/workbench/widgets/layers/LayersPanelHeader.tsxindex 62959c4897..23d3a1ba0d 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/layers/LayersPanelHeader.tsx+++ b/invokeai/frontend/webv2/src/workbench/widgets/layers/LayersPanelHeader.tsx@@ -25,9 +25,6 @@ import { DenoisingStrengthWave } from './DenoisingStrengthWave';import { applyStructural } from './layerOps';const STRENGTH_DEBOUNCE_MS = 250;-const DENOISING_STRENGTH_SLIDER_CSS = {- '& [data-part="range"], & [data-part="track"]': { background: 'transparent' },-} as const;const formatStrengthPercent = (value: number): string => `${Math.round(value * 100)}%`;const clamp01 = (value: number): number => Math.min(1, Math.max(0, value));@@ -290,7 +287,7 @@ const DenoisingStrengthControl = () => {const strengthAriaLabel = useMemo(() => [t('widgets.layers.denoisingStrength')], [t]);const strengthSliderValue = useMemo(() => [draftStrength], [draftStrength]);const strengthNumberValue = useMemo(() => draftStrength.toFixed(2), [draftStrength]);- const strengthTrackDecoration = useMemo(() => <DenoisingStrengthWave value={draftStrength} />, [draftStrength]);+ const strengthWave = useMemo(() => <DenoisingStrengthWave value={draftStrength} />, [draftStrength]);const onSliderChange = useCallback(({ value }: SliderValueChangeDetails) => {@@ -312,11 +309,10 @@ const DenoisingStrengthControl = () => {);return (- <Field label={t('widgets.layers.denoisingStrength')} helpText={t('widgets.layers.denoisingStrengthHelp')}>+ <Field label={t('widgets.layers.denoisingStrength')} labelEnd={strengthWave} orientation="horizontal"><Stack direction="row" gap="2"><Slideraria-label={strengthAriaLabel}- css={DENOISING_STRENGTH_SLIDER_CSS}flex="1"formatValue={formatStrengthPercent}max={MAX_CANVAS_DENOISING_STRENGTH}@@ -324,7 +320,6 @@ const DenoisingStrengthControl = () => {minW="0"size="sm"step={0.01}- trackDecoration={strengthTrackDecoration}value={strengthSliderValue}withThumbTooltiponValueChange={onSliderChange}