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-studio): collapse HiDream to ONE recipe (Dev BF16 + flow_match HD)

mrbizarroc3097ec02d98
diff --git a/agent/image_engine.py b/agent/image_engine.py
index ddc2fdd..ad3d254 100644
--- a/agent/image_engine.py
+++ b/agent/image_engine.py
@@ -201,6 +201,11 @@ class ImageEngineConfig:
# 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.
+ # Dev-edit scheduler. Upstream switched from "flash" -> "flow_match" on
+ # 2026-05-12 — flow_match (FlowMatchEulerDiscreteScheduler from diffusers
+ # via torch CPU bridge) cures the milky/over-textured Dev-edit output we
+ # saw in the morning gallery. Ignored for Full or T2I.
+ hidream_editing_scheduler: str = "flow_match" # "flow_match" | "flash"
def to_public_dict(self) -> dict:
d = asdict(self)
@@ -1250,6 +1255,10 @@ def _generate_hidream(prompt: str, n: int, width: int, height: int,
cmd.extend(["--guidance-scale", str(config.hidream_guidance_scale)])
if refs:
cmd.extend(["--ref-images", *map(str, refs)])
+ # Dev-edit scheduler choice — upstream's 2026-05-12 flow_match is the
+ # default and the recipe we ship. Only meaningful when model_type=dev
+ # AND refs are present; ignored otherwise by the generator.
+ cmd.extend(["--editing-scheduler", config.hidream_editing_scheduler])
if on_log:
on_log(f"[hidream] launching {n} candidate(s) in one process, seeds={seeds}"
+ (f" with {len(refs)} ref(s)" if refs else ""))
diff --git a/mlx_ltx_panel.py b/mlx_ltx_panel.py
index e52cf0e..a24dcba 100644
--- a/mlx_ltx_panel.py
+++ b/mlx_ltx_panel.py
@@ -5398,51 +5398,17 @@ 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 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.
+ # HiDream-O1-Image-Dev BF16 + flow_match Dev-edit scheduler
+ # (upstream's 2026-05-12 default). The ONE recipe we ship —
+ # clean character-preserving edit with smooth cinematic skin
+ # (no pores/freckles overlay), HD 16:9. 28-step distilled, no
+ # CFG. ~18 GB RAM, ~540 s per HD edit on M4 Max.
+ #
+ # The Full (50-step CFG=5) variants were removed: they produce
+ # over-textured "deep-fried" skin on edits per the Civitai
+ # workflow / community findings, and Apple Silicon doesn't
+ # speed up from quantization on this model.
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}")
@@ -6418,10 +6384,7 @@ class Handler(BaseHTTPRequestHandler):
("flux2_edit_high_inline", None, 0.0, 240.0),
("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),
+ ("hidream_inline", None, 0.0, 540.0),
("mock_inline", None, 0.0, 0.5),
]
out = []
@@ -18453,10 +18416,7 @@ 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 (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="hidream_inline">HiDream-O1-Image-Dev BF16 + flow_match HD (character-preserving edit &middot; ~9 min, 18 GB)</option>
<option value="mock_inline" id="imgStudioMockOption" hidden>Mock (testing — debug only)</option>
</select>
<span class="engine-status-pill" id="imgStudioEnginePill"