{"record":{"id":"135806a40665e3e6","repo":"invoke-ai/InvokeAI","slug":"denoising-start-should-be-0-when-initial-latents-a","errorCode":null,"errorMessage":"denoising_start should be 0 when initial latents are not provided.","messagePattern":"denoising_start should be 0 when initial latents are not provided\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/app/invocations/anima_denoise.py","lineNumber":628,"sourceCode":"        # Prepare input latents\n        if init_latents is not None:\n            if self.add_noise:\n                assert noise is not None\n                # Noise the init latents using the first sigma from the clipped\n                # InvokeAI schedule.\n                #\n                # Known limitation: if the selected scheduler later starts from a\n                # different first effective sigma/timestep than sigmas[0], the\n                # img2img preblend below may not match that scheduler exactly.\n                # This is an existing pipeline limitation and affects both\n                # internally generated noise and externally supplied noise.\n                s_0 = sigmas[0]\n                latents = s_0 * noise + (1.0 - s_0) * init_latents\n            else:\n                latents = init_latents\n        else:\n            if self.denoising_start > 1e-5:\n                raise ValueError(\"denoising_start should be 0 when initial latents are not provided.\")\n            assert noise is not None\n            latents = noise\n\n        if total_steps <= 0:\n            return latents.squeeze(2)\n\n        # Prepare inpaint extension\n        inpaint_mask = self._prep_inpaint_mask(context, latents.squeeze(2))\n        inpaint_extension: AnimaInpaintExtension | None = None\n        if inpaint_mask is not None:\n            if init_latents is None:\n                raise ValueError(\"Initial latents are required when using an inpaint mask (image-to-image inpainting)\")\n            assert noise is not None\n            inpaint_extension = AnimaInpaintExtension(\n                init_latents=init_latents.squeeze(2),\n                inpaint_mask=inpaint_mask,\n                noise=noise.squeeze(2),\n                shift=ANIMA_SHIFT,","sourceCodeStart":610,"sourceCodeEnd":646,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/invocations/anima_denoise.py#L610-L646","documentation":"When no initial latents (init_latents) are supplied, the denoise run starts from pure noise, which corresponds to sigma step 0. If denoising_start > 1e-5 the schedule would pretend some steps already ran, so InvokeAI raises this ValueError.","triggerScenarios":"Running Anima denoise in pure txt2img mode (no init_latents input connected) while denoising_start is set to a positive value greater than 1e-5.","commonSituations":"A txt2img workflow where a leftover img2img denoise fraction was left on the node; an img2img image input got disconnected so init_latents became None but the start value stayed; script automation that sets denoising_start without checking whether init image is provided.","solutions":["Set denoising_start to 0 when running without initial latents.","Connect an init image/latents input if you intend to do img2img with a nonzero denoising_start.","Validate the combination in workflow-building code before invoking."],"exampleFix":"// before\ndenoise.denoising_start = 0.4  # no init latents connected\n// after\ndenoise.denoising_start = 0.0  # or provide init_latents","handlingStrategy":"validation","validationCode":"if init_latents is None and denoise.denoising_start > 1e-5:\n    denoise.denoising_start = 0.0  # or supply init latents","typeGuard":null,"tryCatchPattern":"try:\n    output = invoker.invoke(denoise_invocation)\nexcept ValueError as e:\n    if \"initial latents are not provided\" in str(e):\n        denoise.denoising_start = 0.0\n        output = invoker.invoke(denoise_invocation)\n    else:\n        raise","preventionTips":["Tie denoising_start=0 to txt2img mode in your workflow builder","Check that image/init inputs are actually connected before setting a start fraction","Log the start value alongside presence of init_latents"],"tags":["validation","denoising","latents"],"backgroundTag":"invalid-parameter-combination","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}