odysseus-dev/odysseus · error · HTTPException
HiDream generator script not found in snapshot: {script}
Error message
HiDream generator script not found in snapshot: {script} What it means
Raised by _generate_hidream in scripts/mlx_image_server.py with HTTP 500 when the downloaded HiDream snapshot lacks scripts/hidream_o1/generate_hidream_o1_mlx.py. The server shells out to that vendored generator script inside the model repo; a snapshot that omits it (incomplete download or repo revision without the script) cannot generate.
Source
Thrown at scripts/mlx_image_server.py:262
_write_bridge_input_image(image_raw, inp)
_write_bridge_mask(mask_raw, mask)
weights = _weights_path(model)
mode = "fast" if ("mi-gan" in model.lower() or "migan" in model.lower()) else "best"
_run_bridge([
bridge,
"--model", str(weights),
"--image", str(inp),
"--mask", str(mask),
"--output", str(out_path),
"--mode", mode,
])
def _generate_hidream(model: str, prompt: str, out_path: Path, width: int, height: int, steps: int) -> None:
model_path = _snapshot_path(model)
script = model_path / "scripts" / "hidream_o1" / "generate_hidream_o1_mlx.py"
if not script.exists():
raise HTTPException(500, f"HiDream generator script not found in snapshot: {script}")
cmd = [
sys.executable,
str(script),
"--model-path",
str(model_path),
"--prompt",
prompt,
"--output",
str(out_path),
"--width",
str(width),
"--height",
str(height),
"--num-inference-steps",
str(steps),
"--no-snap-resolution",
]
env = os.environ.copy()View on GitHub (pinned to f9235ebbf1)
Solutions
- Purge the snapshot from the HF cache and re-download from the official repo (which vendors the script)
- Confirm on the Hub that the pinned repo/revision actually contains scripts/hidream_o1/generate_hidream_o1_mlx.py
- If using a mirror, switch --model to the canonical HiDream repo id or a local clone that includes the scripts directory
Defensive patterns
Strategy: validation
Validate before calling
from pathlib import Path
script = snapshot / 'scripts' / 'hidream_o1' / 'generate_hidream_o1_mlx.py'
if not script.exists():
purge_snapshot(repo); snapshot_download(repo) # re-fetch Prevention
- After downloading HiDream, assert the vendored script exists before starting the server
- Use the official repo, not weights-only mirrors
- Pin a revision known to include scripts/
When it happens
Trigger: Generating with a model matched by _is_hidream when <snapshot>/scripts/hidream_o1/generate_hidream_o1_mlx.py does not exist: partial snapshot_download, a fork/quantized mirror of the repo that dropped the scripts folder, or snapshot allow_patterns that excluded .py files.
Common situations: HF cache interrupted mid-download; user pointed --model at a weights-only mirror repo; revision pinned to a commit before the script was added; antivirus/backup tooling removed .py files from the cache.
Related errors
- No safetensors weights found for {model} in {snap}
- detail[-4000:]
- Boogu MLX generation failed: {e}
- MLX image generator completed but did not write {out_path}
- MLX Swift bridge completed but did not write {out_path}
AI-assisted analysis of odysseus-dev/odysseus@f9235ebbf1 (2026-08-14).
Data as JSON: /api/errors/7b4411459dfd29ea.
Report an issue: GitHub.