Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: stop the image-strength control reading a legitimate 0 as unset (#4874)

[._.]/ Adam Eivy38046aa960da
diff --git a/client/src/components/videoGen/AdvancedParamsPanel.jsx b/client/src/components/videoGen/AdvancedParamsPanel.jsx
index f544bea41a..e20b634ddb 100644
--- a/client/src/components/videoGen/AdvancedParamsPanel.jsx
+++ b/client/src/components/videoGen/AdvancedParamsPanel.jsx
@@ -66,6 +66,14 @@ export default function AdvancedParamsPanel({
);
const referencePromise = I2V_REFERENCE_MODE_OPTIONS.find((o) => o.value === referenceMode);
const referenceModeLocked = referenceOptions.length < 2;
+ // `0` is a legal strength (ignore the source entirely) and the retry editor
+ // hands it over as a NUMBER, so presence has to be tested explicitly — a
+ // `imageStrength || …` fallback renders the slider at 1 while the form still
+ // submits 0, which is the control lying about the render it will produce.
+ const hasExplicitStrength = imageStrength != null && imageStrength !== '';
+ const displayedImageStrength = hasExplicitStrength
+ ? imageStrength
+ : (effectiveImageStrength != null ? effectiveImageStrength : 1);
const frameOptions = frameOptionsForModel(currentModel, numFrames);
const fpsOptions = fpsOptionsForModel(currentModel);
const samplerLocked = currentModel?.samplerLocked === true;
@@ -272,12 +280,12 @@ export default function AdvancedParamsPanel({
<div className="col-span-2 sm:col-span-3">
<div className="flex items-center justify-between gap-3 mb-1">
<label htmlFor={fieldId('video-image-strength')} className="block text-xs font-medium text-gray-400">Image Strength</label>
- <span className="text-[11px] text-gray-500">{imageStrength || (effectiveImageStrength != null ? String(effectiveImageStrength) : '1.0')}</span>
+ <span className="text-[11px] text-gray-500">{hasExplicitStrength || effectiveImageStrength != null ? String(displayedImageStrength) : '1.0'}</span>
</div>
<input
id={fieldId('video-image-strength')}
type="range" min={0} max={1} step={0.05}
- value={imageStrength || effectiveImageStrength || 1}
+ value={displayedImageStrength}
onChange={(e) => onImageStrengthChange(e.target.value)}
className="w-full accent-port-accent"
title="Higher values preserve the source frame more strongly"
diff --git a/client/src/components/videoGen/AdvancedParamsPanel.test.jsx b/client/src/components/videoGen/AdvancedParamsPanel.test.jsx
index 37268ec318..f266af56d7 100644
--- a/client/src/components/videoGen/AdvancedParamsPanel.test.jsx
+++ b/client/src/components/videoGen/AdvancedParamsPanel.test.jsx
@@ -248,3 +248,31 @@ describe('AdvancedParamsPanel — i2v reference mode (#4874)', () => {
expect(screen.getByText('0.35')).toBeTruthy();
});
});
+
+// `0` is a legal image strength ("ignore the source entirely"), and the Render
+// Queue's retry editor hands it over as a NUMBER. A truthiness fallback rendered
+// the control at 1 while the form still submitted 0 — the control lying about
+// the render it would produce.
+describe('AdvancedParamsPanel — image strength presence vs zero', () => {
+ const inImageMode = (props) => renderPanel({ mode: 'image', ...props });
+
+ it.each([
+ ['a numeric 0 from the retry editor', 0],
+ ['a string "0"', '0'],
+ ])('shows %s as 0, not the 1.0 default', (_label, imageStrength) => {
+ inImageMode({ imageStrength });
+ expect(screen.getByLabelText('Image Strength').value).toBe('0');
+ expect(screen.getByText('0')).toBeTruthy();
+ });
+
+ it('falls back to the pipeline default only when nothing was set', () => {
+ inImageMode({ imageStrength: '' });
+ expect(screen.getByLabelText('Image Strength').value).toBe('1');
+ expect(screen.getByText('1.0')).toBeTruthy();
+ });
+
+ it('prefers an explicit value over the resolved loose default', () => {
+ inImageMode({ imageStrength: 0, effectiveImageStrength: 0.35 });
+ expect(screen.getByLabelText('Image Strength').value).toBe('0');
+ });
+});