Skip to content

Free, open-source AI video generator for Mac. Run LTX-2.5 and MiniMax H3 (Hailuo) locally on Apple Silicon: text-to-video and image-to-video with sound, lip-sync, character LoRA training, songs from lyrics (YuE2) and image editing (Qwen-Image-Edit). One-click install via Pinokio. Offline: no cloud, no API key, no NVIDIA GPU.

feat(image/hidream-full): add 3 Full-recipe engines (BF16, Q8, Q4)

mrbizarro79ef40cd8497
diff --git a/agent/image_engine.py b/agent/image_engine.py
index 7e6b408..0edc04f 100644
--- a/agent/image_engine.py
+++ b/agent/image_engine.py
@@ -192,9 +192,15 @@ class ImageEngineConfig:
# location; override when the lab moves.
hidream_python_path: str = "" # default = HIDREAM_LAB_DIR/.venv/bin/python
hidream_model_path: str = "" # default = HIDREAM_LAB_DIR/mlx_models/hidream-o1-dev-bf16
- hidream_steps: int = 28 # Dev distillation needs the full 28; don't lower
+ hidream_steps: int = 28 # Dev = 28; Full = 50 (auto-overridden when recipe="full")
hidream_noise_scale: float = 7.5 # FlashFlowMatch tuned default; lowering collapses the image
hidream_noise_clip_std: float = 2.5
+ # New for the Full / undistilled variant: pick the lab script's recipe
+ # via --model-type. "dev" = 28-step distilled (existing behaviour);
+ # "full" = 50-step undistilled with CFG + FlowEulerScheduler. The lab
+ # script auto-overrides steps + guidance + shift when model-type=full.
+ hidream_recipe: str = "dev" # "dev" | "full"
+ hidream_guidance_scale: float = 0.0 # 0 = no CFG (Dev). 5.0 typical for Full.
def to_public_dict(self) -> dict:
d = asdict(self)
@@ -1194,6 +1200,7 @@ def _generate_hidream(prompt: str, n: int, width: int, height: int,
cmd = [
py, script,
"--model-path", model,
+ "--model-type", config.hidream_recipe,
"--prompt", prompt,
"--width", str(aligned_w),
"--height", str(aligned_h),
@@ -1204,6 +1211,9 @@ def _generate_hidream(prompt: str, n: int, width: int, height: int,
"--noise-scale-end", str(config.hidream_noise_scale),
"--noise-clip-std", str(config.hidream_noise_clip_std),
]
+ # CFG only fires when guidance > 0 AND no refs (Full edit not supported yet).
+ if config.hidream_guidance_scale and config.hidream_guidance_scale > 0:
+ cmd.extend(["--guidance-scale", str(config.hidream_guidance_scale)])
if refs:
cmd.extend(["--ref-images", *map(str, refs)])
if on_log:
diff --git a/mlx_ltx_panel.py b/mlx_ltx_panel.py
index 549254b..163e5d7 100644
--- a/mlx_ltx_panel.py
+++ b/mlx_ltx_panel.py
@@ -5367,13 +5367,51 @@ def _build_image_engine_config(engine_override: str) -> agent_image_engine.Image
mflux_family="z_image_turbo", mflux_quantize=4,
)
if engine_override == "hidream_inline":
- # HiDream-O1-Image-Dev Q8 (8B Qwen3-VL pixel-patch transformer, MIT).
- # Lab venv at /Users/salo/HIDREAM-O1-MLX-LAB-active/. Strong prompt
- # fidelity at the cost of slowness vs Z-Image-Turbo (~67s vs ~30s)
- # and ~11.5 GB working set (Comfortable+ tier). Defaults are tuned
- # for the Dev distillation; do not change noise_scale or steps without
- # re-evaluating quality.
+ # HiDream-O1-Image-Dev BF16 (28-step distilled, 8B Qwen3-VL pixel-patch
+ # transformer, MIT). Lab venv at /Users/salo/HIDREAM-O1-MLX-LAB-active/.
+ # Strong prompt fidelity at the cost of slowness vs Z-Image-Turbo
+ # (~67s vs ~30s) and ~16 GB working set (Comfortable+ tier).
+ # Native edit + multi-ref supported at BF16.
return agent_image_engine.ImageEngineConfig(kind="hidream")
+ if engine_override == "hidream_full_bf16_inline":
+ # HiDream-O1-Image Full BF16 — undistilled 50-step variant with
+ # CFG=5.0 + shift=3.0 + FlowEulerScheduler. Fixes the "plastic
+ # / creamy skin" complaint Dev has on portraits. ~18 GB RAM,
+ # ~480 s per 1024² image. Edit NOT yet supported on Full (use
+ # Dev for instruction edits).
+ return agent_image_engine.ImageEngineConfig(
+ kind="hidream",
+ hidream_model_path="/Users/salo/HIDREAM-O1-MLX-LAB-active/mlx_models/hidream-o1-full-bf16",
+ hidream_recipe="full",
+ hidream_steps=50,
+ hidream_guidance_scale=5.0,
+ )
+ if engine_override == "hidream_full_q8_inline":
+ # HiDream-O1-Image Full Q8 — same recipe + quality as Full BF16
+ # (verified visually) but with ~12 GB peak RAM instead of 18 GB.
+ # Per-step is the same (Apple Silicon doesn't speed up from Q8
+ # on this model). Pick this to coexist with other GPU work
+ # (video render, training) without OOM.
+ return agent_image_engine.ImageEngineConfig(
+ kind="hidream",
+ hidream_model_path="/Users/salo/HIDREAM-O1-MLX-LAB-active/mlx_models/hidream-o1-full-q8",
+ hidream_recipe="full",
+ hidream_steps=50,
+ hidream_guidance_scale=5.0,
+ )
+ if engine_override == "hidream_full_q4_inline":
+ # HiDream-O1-Image Full Q4 — smallest variant (~8 GB peak RAM).
+ # Fits 16 GB Macs alongside other apps. Quality is close to BF16
+ # but shows mild patch-grid speckle on smooth skin in close-up
+ # portraits. Use for medium/wide shots; prefer Q8 for close
+ # portraits. Same per-step as Q8 (dequant overhead).
+ return agent_image_engine.ImageEngineConfig(
+ kind="hidream",
+ hidream_model_path="/Users/salo/HIDREAM-O1-MLX-LAB-active/mlx_models/hidream-o1-full-q4",
+ hidream_recipe="full",
+ hidream_steps=50,
+ hidream_guidance_scale=5.0,
+ )
if engine_override == "mock_inline":
return agent_image_engine.ImageEngineConfig(kind="mock")
raise ValueError(f"unknown engine_override: {engine_override!r}")
@@ -6350,6 +6388,9 @@ class Handler(BaseHTTPRequestHandler):
("flux2_inline", "Runpod/FLUX.2-klein-4B-mflux-4bit", 4.0, 12.0),
("z_image_turbo_inline", "filipstrand/Z-Image-Turbo-mflux-4bit", 3.0, 6.0),
("hidream_inline", None, 0.0, 130.0),
+ ("hidream_full_bf16_inline", None, 0.0, 480.0),
+ ("hidream_full_q8_inline", None, 0.0, 530.0),
+ ("hidream_full_q4_inline", None, 0.0, 530.0),
("mock_inline", None, 0.0, 0.5),
]
out = []
@@ -18240,7 +18281,10 @@ HTML = r"""<!doctype html>
<option value="flux2_edit_high_inline">FLUX.2 Klein-Base-Edit photoreal (multi-ref &middot; 25-step Q8, ~3-5 min/image)</option>
<option value="flux2_inline">FLUX.2 [klein] 4B (fast T2I, no refs)</option>
<option value="z_image_turbo_inline">Z-Image-Turbo (compact T2I, no refs)</option>
- <option value="hidream_inline">HiDream-O1-Image-Dev BF16 (max-fidelity T2I + native edit/multi-ref &middot; ~67 s/image, 16 GB) [NEW]</option>
+ <option value="hidream_inline">HiDream-O1-Image-Dev BF16 (28-step distilled, T2I + edit + multi-ref &middot; ~67 s/image, 16 GB)</option>
+ <option value="hidream_full_bf16_inline">HiDream-O1-Image FULL BF16 (50-step undistilled w/ CFG &middot; ~480 s/image, 18 GB) [NEW]</option>
+ <option value="hidream_full_q8_inline">HiDream-O1-Image FULL Q8 (same quality as BF16, 12 GB peak RAM) [NEW]</option>
+ <option value="hidream_full_q4_inline">HiDream-O1-Image FULL Q4 (smallest, fits 16 GB Macs, mild skin speckle) [NEW]</option>
<option value="mock_inline" id="imgStudioMockOption" hidden>Mock (testing — debug only)</option>
</select>
<span class="engine-status-pill" id="imgStudioEnginePill"