{"record":{"id":"5d5496b8cf162236","repo":"sgl-project/sglang","slug":"unknown-ideogram-4-preset-preset-r-expected-one","errorCode":null,"errorMessage":"Unknown Ideogram 4 preset {preset!r}; expected one of {sorted(IDEOGRAM4_PRESETS)}","messagePattern":"Unknown Ideogram 4 preset (.+?); expected one of (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/ideogram.py","lineNumber":346,"sourceCode":"        batch.did_sp_shard_latents = False\n\n    def _postprocess_sp_latents(\n        self,\n        batch: Req,\n        latents: torch.Tensor,\n        trajectory_tensor: torch.Tensor | None,\n    ) -> tuple[torch.Tensor, torch.Tensor | None]:\n        return latents, trajectory_tensor\n\n    def verify_input(self, batch: Req, server_args: ServerArgs) -> VerificationResult:\n        return VerificationResult()\n\n    def _prepare_denoising_loop(\n        self, batch: Req, server_args: ServerArgs\n    ) -> DenoisingContext:\n        preset = getattr(batch, \"preset\", \"V4_DEFAULT_20\")\n        if preset not in IDEOGRAM4_PRESETS:\n            raise ValueError(\n                f\"Unknown Ideogram 4 preset {preset!r}; expected one of {sorted(IDEOGRAM4_PRESETS)}\"\n            )\n        preset_cfg = IDEOGRAM4_PRESETS[preset]\n        num_steps = int(preset_cfg[\"num_steps\"])\n        device = get_local_torch_device()\n        schedule = get_schedule_for_resolution(\n            (batch.height, batch.width),\n            known_mean=float(preset_cfg[\"mu\"]),\n            std=float(preset_cfg[\"std\"]),\n        )\n        step_intervals = make_step_intervals(num_steps).to(device)\n        guidance_schedule = torch.as_tensor(\n            preset_cfg[\"guidance_schedule\"], dtype=torch.float32, device=device\n        )\n        schedule_values = schedule(step_intervals)\n        schedule_deltas = schedule_values[:-1] - schedule_values[1:]\n\n        self.scheduler.set_timesteps(num_steps, device=device)","sourceCodeStart":328,"sourceCodeEnd":364,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/ideogram.py#L328-L364","documentation":"The Ideogram 4 denoising loop looks up a named preset in the IDEOGRAM4_PRESETS table; an unknown preset name is rejected before building the schedule. Presets bundle num_steps and schedule settings, so an invalid name has no valid fallback.","triggerScenarios":"Setting batch.preset (or a request field mapped to it) to a string not in IDEOGRAM4_PRESETS, e.g. 'V4_TURBO' typo or 'V3_DEFAULT_20' from an older API version.","commonSituations":"Renamed/removed presets between model versions; hand-built Req objects with the default attribute missing so a stale string is passed; client/server version skew where the client knows newer preset names.","solutions":["Check the error message for the sorted list of valid presets and use one of them","Upgrade sglang so the preset table matches what your client sends","Omit preset to fall back to the 'V4_DEFAULT_20' default"],"exampleFix":"# before\nreq.preset = \"V4_DEFAULT_2O\"  # typo: letter O\n# after\nfrom sglang.multimodal_gen.runtime.pipelines_core.stages.model_specific_stages.ideogram import IDEOGRAM4_PRESETS\nassert req.preset in IDEOGRAM4_PRESETS, sorted(IDEOGRAM4_PRESETS)","handlingStrategy":"validation","validationCode":"from sglang.multimodal_gen.runtime.pipelines_core.stages.model_specific_stages.ideogram import IDEOGRAM4_PRESETS\nif preset not in IDEOGRAM4_PRESETS:\n    preset = \"V4_DEFAULT_20\"","typeGuard":"def is_valid_ideogram_preset(p: str) -> bool:\n    return p in IDEOGRAM4_PRESETS","tryCatchPattern":null,"preventionTips":["Validate preset names against IDEOGRAM4_PRESETS before sending","Pin client and server sglang versions to keep preset tables in sync"],"tags":["ideogram","preset","invalid-enum","validation"],"backgroundTag":"invalid-preset-name","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}