{"record":{"id":"3e9e663f1f5c8c06","repo":"invoke-ai/InvokeAI","slug":"denoising-start-should-be-0-when-initial-latents-a-3e9e66","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":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/app/invocations/wan_denoise.py","lineNumber":588,"sourceCode":"            latent_channels=latent_channels,\n            height=self.height,\n            width=self.width,\n            spatial_scale_factor=spatial_scale,\n            device=device,\n            dtype=latent_dtype,\n            seed=self.seed,\n        )\n\n        # Combine init latents + noise per the schedule's starting sigma.\n        if init_latents_5d is not None:\n            if self.add_noise:\n                s_0 = float(sigmas[0])\n                latents = s_0 * noise + (1.0 - s_0) * init_latents_5d\n            else:\n                latents = init_latents_5d\n        else:\n            if self.denoising_start > 1e-5:\n                raise ValueError(\"denoising_start should be 0 when initial latents are not provided.\")\n            latents = noise\n\n        if total_steps <= 0:\n            return latents.squeeze(2)\n\n        # Inpaint extension (4D space — the existing extension is shape-agnostic\n        # but operates on the squeezed-T shape we use for masks).\n        inpaint_mask = self._prep_inpaint_mask(context, latents.squeeze(2))\n        inpaint_extension: RectifiedFlowInpaintExtension | None = None\n        if inpaint_mask is not None:\n            if init_latents_5d is None:\n                raise ValueError(\"Initial latents are required when using an inpaint mask (img2img inpainting).\")\n            inpaint_extension = RectifiedFlowInpaintExtension(\n                init_latents=init_latents_5d.squeeze(2),\n                inpaint_mask=inpaint_mask,\n                noise=noise.squeeze(2),\n            )\n","sourceCodeStart":570,"sourceCodeEnd":606,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/invocations/wan_denoise.py#L570-L606","documentation":"When no initial latents are supplied (pure text-to-video/image), the Wan denoise run must start from pure noise, so denoising_start must be 0. A non-zero denoising_start implies img2img where sampling begins partway along the sigma schedule using init latents; without them it is contradictory, so the node raises. This prevents silently ignoring denoising_start.","triggerScenarios":"Setting denoising_start > 0 on a WanDenoise node that has no image (and hence no ImageToLatents/initial latents) connected; copying an img2img workflow and disconnecting the image input while leaving denoising_start set.","commonSituations":"Converting an img2img workflow to txt2img by removing the image input; users experimenting with denoising_start for partial redenoising without realizing it requires init latents.","solutions":["Set denoising_start to 0 (or its default) since no initial latents are provided","Or connect an image via Wan Image to Latents so initial latents exist and denoising_start > 0 is meaningful"],"exampleFix":"// before\nwanDenoise: denoising_start=0.7, no image input\n// after\nwanDenoise: denoising_start=0.0  // txt2img\n// or: connect image -> wanImageToLatents -> denoise with denoising_start=0.7","handlingStrategy":"validation","validationCode":"if init_latents is None and denoising_start > 0:\n    raise ValueError(\"denoising_start requires initial latents; set it to 0 for txt2img\")","typeGuard":null,"tryCatchPattern":"try:\n    result = wan_denoise.invoke(context)\nexcept ValueError as e:\n    if 'denoising_start should be 0' in str(e):\n        wan_denoise.denoising_start = 0.0\n    else:\n        raise","preventionTips":["Only set denoising_start > 0 in img2img workflows","Reset denoising_start to 0 when removing the image input","Use img2img workflow templates rather than editing txt2img ones"],"tags":["invokeai","wan","invalid-configuration","img2img"],"backgroundTag":"invalid-parameter-combination","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}