{"record":{"id":"dda81ceb07ddcfe1","repo":"sgl-project/sglang","slug":"unknown-image-vae-encoding-position-image-vae-en","errorCode":null,"errorMessage":"Unknown image_vae_encoding_position: {image_vae_encoding_position}","messagePattern":"Unknown image_vae_encoding_position: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/composed_pipeline_base.py","lineNumber":983,"sourceCode":"                )\n            )\n\n        self.add_standard_latent_preparation_stage()\n        self.add_standard_timestep_preparation_stage(\n            prepare_extra_kwargs=prepare_extra_timestep_kwargs\n        )\n        if image_vae_encoding_position == \"after_latent\":\n            self.add_stage(\n                ImageVAEEncodingStage(\n                    vae=self.get_module(image_vae_key),\n                    **{\n                        \"component_name\": image_vae_key,\n                        **(image_vae_stage_kwargs or {}),\n                    },\n                )\n            )\n        elif image_vae_encoding_position != \"before_timestep\":\n            raise ValueError(\n                f\"Unknown image_vae_encoding_position: {image_vae_encoding_position}\"\n            )\n\n        if denoising_stage_factory is None:\n            self.add_standard_denoising_stage()\n        else:\n            self.add_stage_factory(\n                RoleType.DENOISER,\n                denoising_stage_factory,\n                denoising_stage_name,\n            )\n\n        self.add_standard_decoding_stage()\n        return self\n\n    # TODO(will): don't hardcode no_grad\n    @torch.no_grad()\n    def forward(","sourceCodeStart":965,"sourceCodeEnd":1001,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/composed_pipeline_base.py#L965-L1001","documentation":"This error is thrown by add_standard_ti2v_stages in the multimodal generation pipeline when the image_vae_encoding_position argument is neither the built-in 'before_timestep' position nor a value that triggers the dedicated image-VAE stage registration. It signals an unrecognized enum-like string in the text/image-to-video (TI2V) stage composition config. The library validates this setting because the VAE encoding placement determines where the image condition is injected into the denoising pipeline.","triggerScenarios":"Calling create_pipeline_stages / add_standard_ti2v_stages with image_vae_encoding_position set to a string other than the supported values (the special-cased stage key or 'before_timestep'), e.g. a typo like 'before_timesteps' or 'after_timestep', or passing None/non-string when the pipeline expects a known position.","commonSituations":"Typos in pipeline config YAML/CLI, copying a position name from a different framework version where new positions were added/renamed, or upgrading/downgrading sglang where supported values changed.","solutions":["Check the exact spelling and casing of image_vae_encoding_position against the values handled in composed_pipeline_base.py around the raise (the image_vae stage branch and 'before_timestep')","Set the argument to 'before_timestep' (the no-extra-stage default) or one of the supported stage positions","If you need a new position, extend the if/elif chain in add_standard_ti2v_stages before the raise"],"exampleFix":"# before\npipeline.add_standard_ti2v_stages(image_vae_encoding_position=\"before_timesteps\")\n# after\npipeline.add_standard_ti2v_stages(image_vae_encoding_position=\"before_timestep\")","handlingStrategy":"validation","validationCode":"ALLOWED = {\"before_timestep\"}  # plus the image_vae stage branch values in add_standard_ti2v_stages\nif pos not in ALLOWED:\n    raise ConfigError(f\"unsupported image_vae_encoding_position: {pos!r}; allowed: {sorted(ALLOWED)}\")\npipeline.add_standard_ti2v_stages(image_vae_encoding_position=pos)","typeGuard":"def is_valid_vae_encoding_position(pos: str) -> bool:\n    return isinstance(pos, str) and pos in {\"before_timestep\"}","tryCatchPattern":null,"preventionTips":["Centralize pipeline enum values as constants instead of raw strings","Validate config strings at load time before building pipelines"],"tags":["config-validation","pipeline","multimodal","typo"],"backgroundTag":"invalid-config-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}