{"record":{"id":"3b0d7bac58f3ceea","repo":"invoke-ai/InvokeAI","slug":"denoising-start-must-be-less-than-denoising-end","errorCode":null,"errorMessage":"denoising_start must be less than denoising_end.","messagePattern":"denoising_start must be less than denoising_end\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/app/invocations/krea2_denoise.py","lineNumber":231,"sourceCode":"                )\n            return self.cfg_scale\n        raise ValueError(f\"Invalid CFG scale type: {type(self.cfg_scale)}\")\n\n    @staticmethod\n    def _should_apply_cfg_for_step(cfg_scale: float, *, has_negative_conditioning: bool) -> bool:\n        return has_negative_conditioning and cfg_scale > 1.0\n\n    @staticmethod\n    def _validate_effective_schedule(*, start_idx: int, end_idx: int) -> None:\n        if end_idx <= start_idx:\n            raise ValueError(\n                \"The requested denoising range does not contain any effective denoising steps at the configured \"\n                \"step count. Increase denoising_end, decrease denoising_start, or increase steps.\"\n            )\n\n    def _validate_inputs(self) -> None:\n        if self.denoising_start >= self.denoising_end:\n            raise ValueError(\"denoising_start must be less than denoising_end.\")\n        if self.denoise_mask is not None and self.latents is None:\n            raise ValueError(\"Initial latents are required when a denoise mask is provided.\")\n\n    def _is_distilled(self, context: InvocationContext) -> bool:\n        \"\"\"Whether the transformer is the distilled Turbo checkpoint (fixed mu) vs. Raw (dynamic mu).\n\n        Prefer the classified variant (works for diffusers, single-file and GGUF alike); fall back to\n        the pipeline-level ``is_distilled`` flag in model_index.json, then default to distilled.\n\n        A failed config lookup is a real error and is allowed to propagate — silently defaulting to the\n        Turbo shift would apply the wrong sampling schedule to a Raw model.\n        \"\"\"\n        from invokeai.backend.model_manager.taxonomy import Krea2VariantType\n\n        config = context.models.get_config(self.transformer.transformer)\n        variant = getattr(config, \"variant\", None)\n        if variant is not None:\n            return variant != Krea2VariantType.Base","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/invocations/krea2_denoise.py#L213-L249","documentation":"`_validate_inputs` enforces that the denoising window is a valid interval: denoising_start must be strictly less than denoising_end. Equal or inverted values define an empty or reversed range and are rejected before scheduling.","triggerScenarios":"Setting denoising_start >= denoising_end on the krea2_denoise invocation, e.g. start=0.8, end=0.8, or swapped values like start=0.9, end=0.5.","commonSituations":"UI slider ranges that can collapse to equal values; programmatically generated graphs where start/end variables are swapped; refiner setups configured with a zero-width window.","solutions":["Set denoising_end strictly greater than denoising_start (e.g. start=0.5, end=1.0).","Add a caller-side clamp: if start >= end, widen end or reset to defaults (0.0 / 1.0).","Fix swapped variables in scripts that compute the range dynamically."],"exampleFix":"// before\ndenoising_start=0.9; denoising_end=0.5\n// after\ndenoising_start, denoising_end = min(0.5, 0.9), max(0.5, 0.9)  # 0.5, 0.9","handlingStrategy":"validation","validationCode":"if denoising_start >= denoising_end:\n    raise ValueError(f\"denoising_start ({denoising_start}) must be < denoising_end ({denoising_end})\")","typeGuard":"def is_valid_denoise_window(start: float, end: float) -> bool:\n    return 0.0 <= start < end <= 1.0","tryCatchPattern":"try:\n    out = invoke_krea2_denoise(denoising_start=start, denoising_end=end)\nexcept ValueError as e:\n    if \"must be less than denoising_end\" in str(e):\n        start, end = sorted((start, end))\n        out = invoke_krea2_denoise(denoising_start=start, denoising_end=end)\n    else:\n        raise","preventionTips":["Normalize the window with min/max before constructing the invocation.","Constrain UI sliders so end cannot drop to or below start.","Assert window validity in workflow-generation code."],"tags":["invokeai","krea2","denoising-range","validation"],"backgroundTag":"invalid-parameter-range","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}