{"record":{"id":"08e417140600863f","repo":"unslothai/unsloth","slug":"batched-prompt-seed-lists-are-not-supported-on-the","errorCode":null,"errorMessage":"Batched prompt/seed lists are not supported on the native sd.cpp engine (it renders serially); run on a GPU (diffusers) for batched generation, or use batch_size for a serial native batch.","messagePattern":"Batched prompt/seed lists are not supported on the native sd\\.cpp engine \\(it renders serially\\); run on a GPU \\(diffusers\\) for batched generation, or use batch_size for a serial native batch\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"studio/backend/core/inference/sd_cpp_backend.py","lineNumber":2065,"sourceCode":"    ) -> dict[str, Any]:\n        import tempfile\n\n        from PIL import Image\n\n        from core.inference import diffusion_lora\n\n        if (\n            init_image is not None\n            or mask_image is not None\n            or reference_images\n            or (upscale is not None and upscale > 1)\n        ):\n            raise ValueError(\n                \"img2img / inpaint / reference / upscale are not yet supported on the native \"\n                \"sd.cpp engine; run on a GPU (diffusers) for image-conditioned workflows.\"\n            )\n        if prompts is not None or seeds is not None:\n            raise ValueError(\n                \"Batched prompt/seed lists are not supported on the native sd.cpp engine \"\n                \"(it renders serially); run on a GPU (diffusers) for batched generation, \"\n                \"or use batch_size for a serial native batch.\"\n            )\n        # strength 0/None disables ControlNet (matches diffusers), so no-op it rather than 400.\n        if controlnet is not None and controlnet[3] in (None, 0, 0.0):\n            controlnet = None\n        if controlnet is not None:\n            raise ValueError(\n                \"ControlNet is not yet supported on the native sd.cpp engine; run on a GPU \"\n                \"(diffusers) for ControlNet conditioning.\"\n            )\n\n        cancel = threading.Event()\n        with self._generate_lock:\n            with self._lock:\n                state = self._state\n                if state is None:","sourceCodeStart":2047,"sourceCodeEnd":2083,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/core/inference/sd_cpp_backend.py#L2047-L2083","documentation":"ValueError: the native sd.cpp engine renders serially, so per-image prompt/seed lists (prompts=[...], seeds=[...]) are rejected. The message points to batch_size for a serial native batch or to diffusers on GPU for true batched generation.","triggerScenarios":"generate() with prompts or seeds passed as lists on the native engine.","commonSituations":"Porting a batched diffusers request to a CPU/native host; automation generating galleries from prompt lists.","solutions":["Use batch_size=N with a single prompt/seed for a serial native batch.","Loop generate() per prompt/seed pair on the native engine.","Switch to the diffusers engine on GPU for genuine batched generation."],"exampleFix":"# before\nbackend.generate(prompts=['a cat', 'a dog'], seeds=[1, 2])\n\n# after\nfor p, s in [('a cat', 1), ('a dog', 2)]:\n    backend.generate(prompt=p, seed=s, batch_size=1)","handlingStrategy":"validation","validationCode":"if isinstance(prompts, list) or isinstance(seeds, list):\n    for p, s in zip(prompts or [prompt], seeds or [seed] * len(prompts or [prompt])):\n        submit_native_generate(prompt=p, seed=s)  # serial loop; or use batch_size","typeGuard":"def is_scalar_prompt(prompt, prompts, seed, seeds) -> bool:\n    return prompts is None and seeds is None and isinstance(prompt, str)","tryCatchPattern":null,"preventionTips":["Normalize batched requests at the client boundary: loop or batch_size on native, batch lists on diffusers.","Advertise the native engine's serial contract in API docs to stop list payloads."],"tags":["capability","validation","batching","sd-cpp"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}