Sandpies Claude Opus 5.5 (1M context) commited on
Commit ·
fdffd22
1
Parent(s): 1870c39
RefMod: show Qwen the builder's kept photos, not a decode
Browse filesHTCRefModBuilder now stores each canvas it encoded (mask included; a clip
keeps its 2 fps frames) as a uint8 `looks` tensor beside `latent`. The
chain hands those to the text encoder instead of a VAE decode; a video mod
holds each look for core's FPS//2 stride so Qwen samples every one. Files
without looks (older, Luisa's, PK's) fall back to the decode and keep
their hop key; with looks, the digest joins the per-hop refmods key.
Sharp originals for Qwen is LD's finding (H3 Encode): it is what kept
same-gender characters apart. GPU A/B still owed.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Files changed (4)
- h3_ref_chain.py+19-4
- refmod.py+98-10
- refmod_builder.py+19-7
- tools/check_refmod.py+100
3690 unmodified lines369136923693369436953696369736987 unmodified lines370637073708370937103711371237133714890 unmodified lines46054606460746084609461046114612461346143690 unmodified linesprint(f"[{TAG}] @{_r['tag']}: voice {_inherited} "f"from the RefMod", flush=True)_block = _refmod.visual_block(_loaded, _r["strength"])_pixels = _refmod.presentation_pixels(vae, _loaded["latent"], _r.get("mp") or 0.0)if _loaded["kind"] == "image":_pixels = _pixels[:1]slot_images[_r["slot"]] = _pixels7 unmodified linesf"frames, or save it as an image mod.")slot_videos[_r["slot"]] = _pixelsrefmod_video_blocks[id(_pixels)] = _blockprint(f"[{TAG}] @{_r['tag']}: RefMod {_loaded['kind']} "f"{_loaded['tokens']} tokens, strength {_r['strength']:g}",flush=True)continue_r["kind"] = "image"_im = _media.load_image(_r["file"], cap_mp=_r.get("mp") or 0.0)890 unmodified lines# hop keeps the key it had before RefMods existed. The# pixel digest above is the Qwen view; this is the stored# latent and the strength that actually reach the DiT.**({"refmods": [{"tag": r["tag"],"strength": round(float(r["strength"]), 4),"latent": r.get("latent_digest")}for r in hop_active if r.get("source") == "refmod"]} if any(r.get("source") == "refmod" for r in hop_active)else {}),3690 unmodified lines369136923693369436953696369736983699370037013702370337047 unmodified lines3712371337143715371637173718371937203721372237233724890 unmodified lines4615461646174618461946204621462246234624462546264627462846293690 unmodified linesprint(f"[{TAG}] @{_r['tag']}: voice {_inherited} "f"from the RefMod", flush=True)_block = _refmod.visual_block(_loaded, _r["strength"])# The kept photographs when the builder stored them, so Qwen# reads a face at the resolution it was photographed, not a# VAE decode of it. Keyed per hop through `looks_digest`._looks = _loaded.get("looks")_r["looks_digest"] = _loaded.get("looks_digest")_pixels = _refmod.presentation_pixels(vae, _loaded["latent"], _r.get("mp") or 0.0,looks=_looks, kind=_loaded["kind"])if _loaded["kind"] == "image":_pixels = _pixels[:1]slot_images[_r["slot"]] = _pixels7 unmodified linesf"frames, or save it as an image mod.")slot_videos[_r["slot"]] = _pixelsrefmod_video_blocks[id(_pixels)] = _block_view = (f"Qwen sees {int(_looks.shape[0])} kept photo"f"{'s' if int(_looks.shape[0]) != 1 else ''}"if _looks is not None else"Qwen sees a decode (no kept photos; rebuild to keep them)")print(f"[{TAG}] @{_r['tag']}: RefMod {_loaded['kind']} "f"{_loaded['tokens']} tokens, strength {_r['strength']:g}, "f"{_view}", flush=True)continue_r["kind"] = "image"_im = _media.load_image(_r["file"], cap_mp=_r.get("mp") or 0.0)890 unmodified lines# hop keeps the key it had before RefMods existed. The# pixel digest above is the Qwen view; this is the stored# latent and the strength that actually reach the DiT.# `looks` only when the file keeps photographs: a video# mod's Qwen view is not in `refs`, and a mod without# looks keeps the key it had before they existed.**({"refmods": [{"tag": r["tag"],"strength": round(float(r["strength"]), 4),"latent": r.get("latent_digest"),**({"looks": r["looks_digest"]}if r.get("looks_digest") else {})}for r in hop_active if r.get("source") == "refmod"]} if any(r.get("source") == "refmod" for r in hop_active)else {}),
5 unmodified lines6789101112138 unmodified lines222324252627327 unmodified lines35535635735835936050 unmodified lines411412413414415416417418419183 unmodified lines6036046056066076086096104 unmodified lines6156166176186196204 unmodified lines625626627628629630148 unmodified lines77978078178278378478519 unmodified lines8058068078088098108118128138148158167 unmodified lines8248258268278288298308315 unmodified linesthe rail can read.The stored tensor is the VAE latent. Decoding it and encoding it again is adifferent reference: the pooled latent would be gone. Callers show Qwen adecode and hand the DiT `visual_block()`."""from __future__ import annotations8 unmodified linesTAG = "HandTieClips"META_KEY = "refmod_meta"FORMAT_VERSION = 4SKIP_DIRS = {".git", "__pycache__", "graph_presets"}327 unmodified linesreturn load_file(path, device="cpu")[key].clone()def _as_visual(meta, latent, where):kind = str(meta.get("kind") or "")if kind not in ("image", "video"):50 unmodified linesprint(f"[{TAG}] {name}: using visual member {index} "f"({member.get('name') or member.get('kind')})", flush=True)latent = _load_tensor(path, f"ref_{index}")return _as_visual(member, latent, name)latent = _load_tensor(path, "latent")return _as_visual(meta, latent, name)def _blur_latent(z, factor=8):183 unmodified linesreturn blockdef presentation_pixels(vae, latent, cap_mp=0.0):"""Decode a stored latent into IMAGE pixels for the text encoder.Image mods come back `[1,H,W,C]`. Video mods come back `[T,H,W,C]`.`cap_mp` shrinks this view only. The latent handed to the DiT is the4 unmodified linesexcept ImportError:import media as _mediapixels = vae.decode(latent)if pixels.ndim == 5 and pixels.shape[0] == 1 and pixels.shape[1] == 1:pixels = pixels[:, 0]4 unmodified linesif pixels.ndim != 4 or pixels.shape[-1] != 3:_fail(f"VAE decode of a RefMod came back as {tuple(pixels.shape)}, "f"which is not an image batch")h, w = int(pixels.shape[1]), int(pixels.shape[2])tw, th = _media._mp_cap_size(w, h, cap_mp)if (tw, th) != (w, h):148 unmodified linesdef metadata_for(name, kind, latent, mode, source, source_shape, pool, steps,plan=None, description="", mask=None):t, h, w = (int(latent.shape[2]), int(latent.shape[3]), int(latent.shape[4]))return {"name": name,19 unmodified lines# How the background was suppressed, if it was: `{"source":# "auto"|"wired", "background_retention": r}`. Empty is unmasked."subject_mask": mask if isinstance(mask, dict) else {},"_format_version": FORMAT_VERSION,"sample_rate": 32000,}def save_latent(directory, name, latent, meta):"""Atomic write. Returns the stem the rail stores in `file`."""from safetensors.torch import save_file7 unmodified linesdir=os.path.dirname(dest) or ".")os.close(fd)try:save_file({"latent": latent.detach().cpu().contiguous()}, temporary,metadata={META_KEY: json.dumps(meta)})os.replace(temporary, dest)finally:if os.path.exists(temporary):5 unmodified lines678910111213148 unmodified lines23242526272829303132327 unmodified lines36036136236336436536636736836937037137237337437537637737837938038150 unmodified lines432433434435436437438439440441442443444445446447183 unmodified lines6316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856864 unmodified lines6916926936946956966976986994 unmodified lines704705706707708709710711712713148 unmodified lines86286386486586686786819 unmodified lines8888898908918928938948958968978988999009019027 unmodified lines9109119129139149159169179189195 unmodified linesthe rail can read.The stored tensor is the VAE latent. Decoding it and encoding it again is adifferent reference: the pooled latent would be gone. Callers hand the DiT`visual_block()`, and show Qwen the pictures the builder encoded when thefile keeps them (`looks`), or a decode of the latent when it does not."""from __future__ import annotations8 unmodified linesTAG = "HandTieClips"META_KEY = "refmod_meta"FORMAT_VERSION = 4# The pictures the builder encoded, uint8 [N,H,W,3] beside `latent`. Luisa's# loader reads `latent` by key and her bundle writer carries unknown tensors# through, so the extra key does not cost the file its portability.LOOKS_KEY = "looks"SKIP_DIRS = {".git", "__pycache__", "graph_presets"}327 unmodified linesreturn load_file(path, device="cpu")[key].clone()def _load_looks(path):"""The kept pictures, or None for a file written without them."""from safetensors import safe_openwith safe_open(path, framework="pt", device="cpu") as handle:if LOOKS_KEY not in handle.keys():return Nonelooks = handle.get_tensor(LOOKS_KEY).clone()if looks.ndim != 4 or looks.shape[-1] != 3 or looks.shape[0] < 1:print(f"[{TAG}] {os.path.basename(path)}: looks tensor is "f"{tuple(looks.shape)}, not [N,H,W,3]. Showing Qwen a decode.",flush=True)return Nonereturn looksdef _as_visual(meta, latent, where):kind = str(meta.get("kind") or "")if kind not in ("image", "video"):50 unmodified linesprint(f"[{TAG}] {name}: using visual member {index} "f"({member.get('name') or member.get('kind')})", flush=True)latent = _load_tensor(path, f"ref_{index}")loaded = _as_visual(member, latent, name)loaded["looks"] = Noneloaded["looks_digest"] = Nonereturn loadedlatent = _load_tensor(path, "latent")loaded = _as_visual(meta, latent, name)looks = _load_looks(path)loaded["looks"] = looksloaded["looks_digest"] = tensor_digest(looks) if looks is not None else Nonereturn loadeddef _blur_latent(z, factor=8):183 unmodified linesreturn blockdef qwen_stride():"""Frames between the samples core shows Qwen of a reference video.Core's `FPS // 2`: a reference clip reaches the text encoder at 2 fps.Read from core so a change there moves this with it."""try:from comfy_extras.nodes_minimax_h3 import FPSexcept Exception:FPS = 24return max(1, int(FPS) // 2)def looks_from(canvas, clip=False):"""The pictures to keep for Qwen from one encoded source, as uint8.A still keeps itself. A clip keeps the frames core would sample for Qwenanyway, so a mod does not carry a whole clip's pixels to show two asecond of it."""frames = canvas[::qwen_stride()] if clip else canvasreturn (frames[..., :3].float().clamp(0, 1) * 255.0).round().to(torch.uint8).cpu()def hold_looks(looks):"""Lay the kept pictures out as a reference clip Qwen sees one each of.Core snaps a reference video down to 17k+5 frames and samples it every`qwen_stride()` frames, so each picture is held for one stride and thelast is held until the snapped length still reaches it. The last picturemay be sampled twice; no earlier one is skipped."""stride = qwen_stride()n = int(looks.shape[0])need = max(5, stride * (n - 1) + 1)length = 5while length < need:length += 17idx = torch.clamp(torch.arange(length) // stride, max=n - 1)return looks[idx]def presentation_pixels(vae, latent, cap_mp=0.0, looks=None, kind="image"):"""IMAGE pixels for the text encoder.With `looks`, the pictures the builder encoded: sharp, one Qwen frame perpicture. Without them, a decode of the stored latent -- the only view amod written elsewhere, or before looks existed, can give. A decode of astacked multi-still latent is also a clip the VAE invents between thestills, which is not what anybody photographed.Image mods come back `[1,H,W,C]`. Video mods come back `[T,H,W,C]`.`cap_mp` shrinks this view only. The latent handed to the DiT is the4 unmodified linesexcept ImportError:import media as _mediaif looks is not None:view = looks[:1] if kind == "image" else hold_looks(looks)return _cap(view.float() / 255.0, cap_mp, _media)pixels = vae.decode(latent)if pixels.ndim == 5 and pixels.shape[0] == 1 and pixels.shape[1] == 1:pixels = pixels[:, 0]4 unmodified linesif pixels.ndim != 4 or pixels.shape[-1] != 3:_fail(f"VAE decode of a RefMod came back as {tuple(pixels.shape)}, "f"which is not an image batch")return _cap(pixels, cap_mp, _media)def _cap(pixels, cap_mp, _media):h, w = int(pixels.shape[1]), int(pixels.shape[2])tw, th = _media._mp_cap_size(w, h, cap_mp)if (tw, th) != (w, h):148 unmodified linesdef metadata_for(name, kind, latent, mode, source, source_shape, pool, steps,plan=None, description="", mask=None, looks=0):t, h, w = (int(latent.shape[2]), int(latent.shape[3]), int(latent.shape[4]))return {"name": name,19 unmodified lines# How the background was suppressed, if it was: `{"source":# "auto"|"wired", "background_retention": r}`. Empty is unmasked."subject_mask": mask if isinstance(mask, dict) else {},# How many pictures the `looks` tensor holds. 0: Qwen is shown a# decode of the latent."looks": int(looks or 0),"_format_version": FORMAT_VERSION,"sample_rate": 32000,}def save_latent(directory, name, latent, meta, looks=None):"""Atomic write. Returns the stem the rail stores in `file`."""from safetensors.torch import save_file7 unmodified linesdir=os.path.dirname(dest) or ".")os.close(fd)try:tensors = {"latent": latent.detach().cpu().contiguous()}if looks is not None:tensors[LOOKS_KEY] = looks.to(torch.uint8).cpu().contiguous()save_file(tensors, temporary, metadata={META_KEY: json.dumps(meta)})os.replace(temporary, dest)finally:if os.path.exists(temporary):
16 unmodified lines171819202122114 unmodified lines1371381391401411421431 unmodified line1451461471481491501513 unmodified lines1551561571581591606 unmodified lines16716816917017117217317417517671 unmodified lines24824925025125225325411 unmodified lines26626726826927027116 unmodified lines28828929029129229329429529629729829916 unmodified lines"""from __future__ import annotationsfrom . import media as _mediafrom . import refmod as _refmod114 unmodified linesreturn _refmod.isolate_subject(canvas, m, masking["retention"])def _encode_plan(self, vae, stills, clip, masking=None):"""Every source onto one canvas, encoded, stacked along time."""first = _media.load_image(stills[0]) if stills else Noneif first is None:first = _media.load_video(clip["file"], max_frames=1,1 unmodified lineif first is None:_refmod._fail(_refmod.source_problem(clip['file'], ("video",)) or f"mod_plan source {clip['file']} could not be read")tw, th = _refmod.canvas_size(first)parts, shapes = [], []count = len(stills) + (1 if clip else 0)for i, name in enumerate(stills):px = _media.load_image(name)3 unmodified linesz = vae.encode(canvas)self._check_encode(z, name)parts.append(z)shapes.append(f"{name} 1f")if clip:px = _media.load_video(clip["file"], max_frames=clip["frames"] or None,6 unmodified linesz = vae.encode(canvas)self._check_encode(z, clip["file"])parts.append(z)shapes.append(f"{clip['file']} {int(px.shape[0])}f")print(f"[{TAG}] RefMod sources on a {tw}x{th} canvas: "f"{', '.join(shapes)}", flush=True)return _refmod.stack_latents(parts, "mod_plan")def _check_encode(self, z, where):if z.ndim != 5:71 unmodified linesif images is not None or video is not None:print(f"[{TAG}] mod_plan names sources, so the images/video "f"sockets are ignored", flush=True)full = self._encode_plan(vae, stills, clip, masking)source = "video" if clip else ("image" if len(stills) == 1 else "images")else:if images is None and video is None:11 unmodified linescanvas = self._isolated(_refmod.fit_canvas(frames), 0, 1, masking)full = vae.encode(canvas)self._check_encode(full, stem)source_shape = "x".join(str(int(n)) for n in full.shape[2:])steps = 016 unmodified lines* (int(latent.shape[4]) // 2))meta = _refmod.metadata_for(stem, kind, latent, mode, source, source_shape, pool_label, steps,plan=plan_used, description=description, mask=mask_meta)if save:root = _refmod.register_folder()written = _refmod.save_latent(root, stem, latent, meta)print(f"[{TAG}] wrote RefMod {written} ({kind}, {meta['latent_t']}x"f"{meta['latent_h']}x{meta['latent_w']}, {mode}, {tokens} tokens"+ (f", voice {voice}" if voice else "") + ")",flush=True)return (written,)16 unmodified lines1718192021222324114 unmodified lines1391401411421431441451461471481491501 unmodified line1521531541551561571583 unmodified lines1621631641651661671686 unmodified lines17517617717817918018118218318418571 unmodified lines25725825926026126226311 unmodified lines27527627727827928028116 unmodified lines29829930030130230330430530630730830931031116 unmodified lines"""from __future__ import annotationsimport torchfrom . import media as _mediafrom . import refmod as _refmod114 unmodified linesreturn _refmod.isolate_subject(canvas, m, masking["retention"])def _encode_plan(self, vae, stills, clip, masking=None):"""Every source onto one canvas, encoded, stacked along time.Returns the latent and the pictures to keep for Qwen: each canvas asit went into the VAE, mask and all, so the text encoder and the DiTare shown the same subject."""first = _media.load_image(stills[0]) if stills else Noneif first is None:first = _media.load_video(clip["file"], max_frames=1,1 unmodified lineif first is None:_refmod._fail(_refmod.source_problem(clip['file'], ("video",)) or f"mod_plan source {clip['file']} could not be read")tw, th = _refmod.canvas_size(first)parts, shapes, looks = [], [], []count = len(stills) + (1 if clip else 0)for i, name in enumerate(stills):px = _media.load_image(name)3 unmodified linesz = vae.encode(canvas)self._check_encode(z, name)parts.append(z)looks.append(_refmod.looks_from(canvas[:1]))shapes.append(f"{name} 1f")if clip:px = _media.load_video(clip["file"], max_frames=clip["frames"] or None,6 unmodified linesz = vae.encode(canvas)self._check_encode(z, clip["file"])parts.append(z)looks.append(_refmod.looks_from(canvas, clip=True))shapes.append(f"{clip['file']} {int(px.shape[0])}f")print(f"[{TAG}] RefMod sources on a {tw}x{th} canvas: "f"{', '.join(shapes)}", flush=True)return _refmod.stack_latents(parts, "mod_plan"), torch.cat(looks, dim=0)def _check_encode(self, z, where):if z.ndim != 5:71 unmodified linesif images is not None or video is not None:print(f"[{TAG}] mod_plan names sources, so the images/video "f"sockets are ignored", flush=True)full, looks = self._encode_plan(vae, stills, clip, masking)source = "video" if clip else ("image" if len(stills) == 1 else "images")else:if images is None and video is None:11 unmodified linescanvas = self._isolated(_refmod.fit_canvas(frames), 0, 1, masking)full = vae.encode(canvas)self._check_encode(full, stem)looks = _refmod.looks_from(canvas, clip=video is not None)source_shape = "x".join(str(int(n)) for n in full.shape[2:])steps = 016 unmodified lines* (int(latent.shape[4]) // 2))meta = _refmod.metadata_for(stem, kind, latent, mode, source, source_shape, pool_label, steps,plan=plan_used, description=description, mask=mask_meta,looks=int(looks.shape[0]))if save:root = _refmod.register_folder()written = _refmod.save_latent(root, stem, latent, meta, looks=looks)print(f"[{TAG}] wrote RefMod {written} ({kind}, {meta['latent_t']}x"f"{meta['latent_h']}x{meta['latent_w']}, {mode}, {tokens} tokens, "f"{meta['looks']} kept for Qwen"+ (f", voice {voice}" if voice else "") + ")",flush=True)return (written,)
528 unmodified lines529530531532533534535528 unmodified linesBM.isolate_subject = realif __name__ == "__main__":test_subject_mask()test_builder_mask()test_schedule()528 unmodified lines529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635528 unmodified linesBM.isolate_subject = realdef test_looks():"""Kept photos: stored beside the latent, shown to Qwen one frame each."""stride = M.qwen_stride()ck("the Qwen stride is core's 2 fps", stride == 12, str(stride))# Core's own sampling of a reference clip, restated: snap down to 17k+5,# then every stride-th frame. Every picture must be seen, in order.def core_samples(n):while n % 17 != 5:n -= 1return list(range(0, n, stride))for n in (1, 2, 3, 5, 8, 12):looks = torch.arange(n, dtype=torch.uint8).reshape(n, 1, 1, 1).expand(n, 2, 2, 3)held = M.hold_looks(looks)seen = [int(held[i, 0, 0, 0]) for i in core_samples(int(held.shape[0]))]ck(f"{n} held looks reach Qwen once each, in order",int(held.shape[0]) % 17 == 5 and sorted(set(seen)) == list(range(n))and seen == sorted(seen), f"len {held.shape[0]} seen {seen}")canvas = torch.rand(30, 4, 4, 3)ck("a clip keeps the frames Qwen samples",M.looks_from(canvas, clip=True).shape[0] == 3)kept = M.looks_from(canvas[:1])ck("a still keeps itself as uint8",kept.dtype == torch.uint8 and kept.shape == (1, 4, 4, 3)and torch.allclose(kept.float() / 255, canvas[:1], atol=1 / 255))latent = torch.zeros(1, 24, 2, 2, 2)looks = (torch.rand(2, 32, 32, 3) * 255).to(torch.uint8)meta = M.metadata_for("duo", "video", latent, "encode", "images", "2x2x2","encode", 0, looks=2)ck("the header counts the looks", meta["looks"] == 2)with tempfile.TemporaryDirectory() as tmp:M.save_latent(tmp, "duo", latent, meta, looks=looks)M.save_latent(tmp, "old", latent[:, :, :1],M.metadata_for("old", "image", latent[:, :, :1], "encode","image", "1x2x2", "encode", 0))M.roots = lambda: [tmp]got = M.load_visual("duo")ck("looks round-trip byte for byte", torch.equal(got["looks"], looks))ck("looks carry a digest", bool(got["looks_digest"]))old = M.load_visual("old")ck("a mod written without looks loads with none",old["looks"] is None and old["looks_digest"] is None)class NoVAE:def decode(self, _z):raise AssertionError("decoded a mod that keeps its photos")view = M.presentation_pixels(NoVAE(), got["latent"], looks=looks, kind="video")ck("a video mod with looks is shown them, not a decode",view.shape[0] % 17 == 5 and view.shape[1:] == (32, 32, 3)and torch.allclose(view[0], looks[0].float() / 255))one = M.presentation_pixels(NoVAE(), got["latent"], looks=looks[:1], kind="image")ck("an image mod with looks is one picture", one.shape == (1, 32, 32, 3))big = torch.zeros(1, 256, 256, 3, dtype=torch.uint8)capped = M.presentation_pixels(NoVAE(), got["latent"], cap_mp=0.01,looks=big, kind="image")ck("mp still caps the kept photo", capped.shape[1] < 256, str(tuple(capped.shape)))def test_builder_looks():"""The builder keeps each canvas as encoded, and writes it."""import importlibimport typespkg = types.ModuleType("htc_pack")pkg.__path__ = [_PACK]sys.modules.setdefault("htc_pack", pkg)B = importlib.import_module("htc_pack.refmod_builder")BM = sys.modules["htc_pack.refmod"]class VAE:def encode(self, px):t = 1 + (px.shape[0] - 1) // 4return torch.ones(1, 24, t, px.shape[1] // 16, px.shape[2] // 16)written = {}real_save, real_folder = BM.save_latent, BM.register_folderBM.register_folder = lambda: "unused"BM.save_latent = lambda d, n, lat, meta, looks=None: (written.update(meta=meta, looks=looks), n)[1]try:still = torch.rand(1, 256, 320, 3)B.HTCRefModBuilder().build(VAE(), "m", "encode", images=still, build="start",mask=torch.ones(1, 256, 320),background_retention=0.0)ck("the builder writes the still it encoded",written["looks"].shape == (1, 256, 320, 3) and written["meta"]["looks"] == 1)clip = torch.rand(39, 64, 64, 3)B.HTCRefModBuilder().build(VAE(), "m", "encode", video=clip, build="start")ck("a clip keeps its 2 fps frames",written["looks"].shape[0] == 4 and written["meta"]["looks"] == 4,str(tuple(written["looks"].shape)))finally:BM.save_latent, BM.register_folder = real_save, real_folderif __name__ == "__main__":test_looks()test_builder_looks()test_subject_mask()test_builder_mask()test_schedule()
h3_ref_chain.py+19-4
refmod.py+98-10
refmod_builder.py+19-7
tools/check_refmod.py+100