{"record":{"id":"1aa65cfefb8f4466","repo":"invoke-ai/InvokeAI","slug":"denoising-start-should-be-0-when-initial-latents-a-1aa65c","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/flux_denoise.py","lineNumber":334,"sourceCode":"            if self.add_noise:\n                assert noise is not None\n                # Noise the orig_latents by the appropriate amount for the first\n                # timestep in InvokeAI's clipped schedule.\n                #\n                # Known limitation: if the selected scheduler later replaces this\n                # schedule with its own first effective timestep/sigma (for example\n                # Heun internal expansion or LCM's scheduler-defined schedule), the\n                # img2img preblend below may not match that scheduler's true first\n                # step exactly. This is an existing pipeline limitation and affects\n                # both internally generated noise and externally supplied noise.\n                t_0 = timesteps[0]\n                x = t_0 * noise + (1.0 - t_0) * init_latents\n            else:\n                x = init_latents\n        else:\n            # init_latents are not provided, so we are not doing image-to-image (i.e. we are starting from pure noise).\n            if self.denoising_start > 1e-5:\n                raise ValueError(\"denoising_start should be 0 when initial latents are not provided.\")\n\n            assert noise is not None\n            x = noise\n\n        # If len(timesteps) == 1, then short-circuit. We are just noising the input latents, but not taking any\n        # denoising steps.\n        if len(timesteps) <= 1:\n            return x\n\n        if is_schnell and self.control_lora:\n            raise ValueError(\"Control LoRAs cannot be used with FLUX Schnell\")\n\n        # Prepare the extra image conditioning tensor (img_cond) for either FLUX structural control or FLUX Fill.\n        img_cond: torch.Tensor | None = None\n        is_flux_fill = transformer_config.variant is FluxVariantType.DevFill\n        if is_flux_fill:\n            img_cond = self._prep_flux_fill_img_cond(context, device=device, dtype=inference_dtype)\n        else:","sourceCodeStart":316,"sourceCodeEnd":352,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/invocations/flux_denoise.py#L316-L352","documentation":"When no initial latents are supplied, FLUX denoising starts from pure noise, so denoising_start must be 0 — there is nothing to partially skip. A denoising_start greater than 1e-5 in a txt2img run is contradictory and raises this ValueError.","triggerScenarios":"_run_diffusion takes the init_latents-is-None branch while self.denoising_start > 1e-5; running a text-to-image graph where a denoising_start value intended for img2img was left set.","commonSituations":"Reusing an img2img graph for txt2img without resetting denoising_start; a scheduler/denoise param node still feeding a nonzero start; saving denoising_start in a preset and switching modes.","solutions":["Set denoising_start to 0 when no initial latents are provided","If you intend img2img, supply the initial latents input to the denoise node","Check upstream denoising_start/scheduler param nodes for leftover nonzero values"],"exampleFix":"// before: txt2img with img2img setting\nFluxDenoiseInvocation(noise=noise, denoising_start=0.5)\n// after\nFluxDenoiseInvocation(noise=noise, denoising_start=0.0)","handlingStrategy":"validation","validationCode":"if initial_latents is None and denoising_start > 1e-5:\n    raise ValueError('Set denoising_start=0 for txt2img, or provide initial latents for img2img')","typeGuard":null,"tryCatchPattern":"try:\n    result = flux_denoise.invoke(context)\nexcept ValueError as e:\n    if 'denoising_start should be 0' in str(e):\n        flux_denoise.denoising_start = 0.0\n        result = flux_denoise.invoke(context)\n    else:\n        raise","preventionTips":["Reset denoising_start to 0 when switching img2img graphs to txt2img","Ensure the initial latents input is connected whenever denoising_start > 0","Audit scheduler param nodes for stale nonzero start values"],"tags":["denoising","validation","txt2img"],"backgroundTag":"invalid-parameter-combination","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}