Rename to Halide Preview
Browse filesFiles changed (3)
- README.md+12-12
- config.json+1-1
- mica_modeling.py → halide_modeling.pyRenamed+12-12
4 unmodified lines56788910113 unmodified lines15161718181920202122222324251 unmodified line272829303031323312 unmodified lines464748494950515211 unmodified lines6465666767686969707172727374752 unmodified lines78798081818283848586868788898 unmodified lines98991001011011021034 unmodified linespipeline_tag: text-to-imagelibrary_name: pytorchtags: - mica - halide - text-to-image - flow-matching - fcdm3 unmodified lines - preview---
<img src="banner.png" alt="Halide Preview" width="100%"># Halide Preview
**Mica Preview** is a small, experimental 194M-parameter English text-to-image flow-matching model trained from scratch at 768×768 resolution. It is our first working research preview from the Mica image-generation family — built to test whether a recurrent Perceiver "thinker" paired with a pure-ConvNeXt V2 renderer can produce coherent high-resolution imagery at a fraction of the parameter count of standard diffusion Transformers.**Halide Preview** is a small, experimental 194M-parameter English text-to-image flow-matching model trained from scratch at 768×768 resolution. It is our first working research preview from the Halide image-generation family — built to test whether a recurrent Perceiver "thinker" paired with a pure-ConvNeXt V2 renderer can produce coherent high-resolution imagery at a fraction of the parameter count of standard diffusion Transformers.
It is still early. Trained to step 291,000 (~4.66M image-caption samples seen), Mica Preview is not meant to rival large billion-parameter image models yet — it is a transparent, self-contained checkpoint and a starting point for what comes next.It is still early. Trained to step 291,000 (~4.66M image-caption samples seen), Halide Preview is not meant to rival large billion-parameter image models yet — it is a transparent, self-contained checkpoint and a starting point for what comes next.
---
1 unmodified line
All samples below were generated directly from the released EMA weights at **768×768** (`50` Euler steps, CFG `4.0`, resolution shift `2.5`, uncurated single seed per prompt):

| Sample | Prompt ||---|---|12 unmodified lines
## Architecture & Training
Mica Preview separates global semantic planning from local spatial rendering in plain PyTorch (`mica_modeling.py`, no custom CUDA extensions required):Halide Preview separates global semantic planning from local spatial rendering in plain PyTorch (`halide_modeling.py`, no custom CUDA extensions required):
- **Parameters:** 194,328,196 total (`192,230,532` generator + `2,097,664` text adapter, released as EMA weights `decay = 0.9995`)- **Thinker (Global Planner):** Perceiver-style Transformer operating on a 24×24 spatial plan grid + 16 global tokens (`p_dim = 256`, `dim = 640`, 4 perceiver blocks, 3 prelude + 3 recurrent core × 4 loops + 2 coda blocks, 2D RoPE, QK-RMSNorm, multi-resolution ConvRead branch)11 unmodified linesfrom diffusers import AutoencoderKLfrom huggingface_hub import hf_hub_downloadfrom safetensors.torch import load_filefrom mica_modeling import DistillT5TextEncoder, MicaConfig, MicaGenerator, VAE_REPO, sample_micafrom halide_modeling import DistillT5TextEncoder, HalideConfig, HalideGenerator, VAE_REPO, sample_halide
repo_id = "Emergent-Knowledge/mica-preview"repo_id = "Emergent-Knowledge/halide-preview"device = "cuda" if torch.cuda.is_available() else "cpu"
model = MicaGenerator(MicaConfig())model = HalideGenerator(HalideConfig())model.load_state_dict(load_file(hf_hub_download(repo_id, "generator.safetensors")), strict=True)model = model.to(device).eval()
2 unmodified lines
vae = AutoencoderKL.from_pretrained(VAE_REPO, torch_dtype=torch.bfloat16 if device == "cuda" else torch.float32).to(device).eval()
images = sample_mica(images = sample_halide( model, text_enc, vae, prompts=["A breathtaking sunrise over snow-capped Alpine peaks reflected in a calm turquoise glacial lake"], steps=50, cfg=4.0, shift=2.5, resolution=768, seed=42, device=device,)images[0].save("mica_sample.png")images[0].save("halide_sample.png")```
---8 unmodified lines
## Acknowledgements & License
Mica Preview builds on open research and open weights from the community — including FCDM (`arXiv:2603.09408`), Agate Thinker-Renderer architectures, [`LifuWang/DistillT5`](https://huggingface.co/LifuWang/DistillT5), [`google-t5/t5-base`](https://huggingface.co/google-t5/t5-base), and [`stabilityai/sd-vae-ft-mse`](https://huggingface.co/stabilityai/sd-vae-ft-mse).Halide Preview builds on open research and open weights from the community — including FCDM (`arXiv:2603.09408`), Agate Thinker-Renderer architectures, [`LifuWang/DistillT5`](https://huggingface.co/LifuWang/DistillT5), [`google-t5/t5-base`](https://huggingface.co/google-t5/t5-base), and [`stabilityai/sd-vae-ft-mse`](https://huggingface.co/stabilityai/sd-vae-ft-mse).
Released under the **Apache-2.0** license.122345{ "model_type": "mica_v5_fcdm_thinker2", "model_type": "halide_v5_fcdm_thinker2", "step": 291000, "samples_seen": 4656000, "ema": true,1123422 unmodified lines272829303031323334353636373839287 unmodified lines32732832933033133033133233333477 unmodified lines41241341441541641541641741841841942042142242242342442562 unmodified lines4884894904914914924934941 unmodified line49649749849949950050150249 unmodified lines552553554555555556557558"""Mica Preview (v5, 768px): Portable PyTorch inference model & pipeline."""Halide Preview (v5, 768px): Portable PyTorch inference model & pipeline.
Architecture: - 192.2M-param FCDM-Thinker2-MR (flat 768px mode, 96x96 SD-VAE latent grid)22 unmodified linesDISTILLT5_TOKENIZER_REPO = "google-t5/t5-base"DISTILLT5_D_MODEL = 768DISTILLT5_OUT_DIM = 4096MICA_CTX_DIM = 512HALIDE_CTX_DIM = 512VAE_REPO = "stabilityai/sd-vae-ft-mse"VAE_SCALE = 0.18215
@dataclassclass MicaConfig:class HalideConfig: latent_ch: int = 4 widths: list[int] = field(default_factory=lambda: [288, 832, 1664]) depths: list[int] = field(default_factory=lambda: [4, 6, 2])287 unmodified lines return ctx + on * self.gate.to(ctx.dtype) * (code - ctx)
class MicaThinker(nn.Module): def __init__(self, cfg: MicaConfig):class HalideThinker(nn.Module): def __init__(self, cfg: HalideConfig): super().__init__() self.grid, self.n_global, self.n_freq, self.rope = cfg.grid, cfg.n_global, cfg.n_freq, cfg.rope self.loops = cfg.loops77 unmodified lines return out[:, :g * g].transpose(1, 2).reshape(B, -1, g, g)
class MicaGenerator(nn.Module): def __init__(self, cfg: MicaConfig | None = None):class HalideGenerator(nn.Module): def __init__(self, cfg: HalideConfig | None = None): super().__init__() cfg = cfg or MicaConfig() cfg = cfg or HalideConfig() self.cfg = cfg self.native = 2 * cfg.grid self.loops = cfg.loops self.thinker = MicaThinker(cfg) self.thinker = HalideThinker(cfg) self.mr_count = CountCode(cfg.ctx_dim)
w0, w1, w2 = cfg.widths62 unmodified lines
class DistillT5TextEncoder: """LifuWang/DistillT5 (with explicit key remap) + google-t5/t5-base tokenizer + Mica ctx_proj.""" """LifuWang/DistillT5 (with explicit key remap) + google-t5/t5-base tokenizer + Halide ctx_proj."""
def __init__(self, device: str = "cuda", max_len: int = 512): self.device = device1 unmodified line self.tokenizer = None self.encoder = None self.final_projection = None self.ctx_proj = nn.Linear(DISTILLT5_OUT_DIM, MICA_CTX_DIM) self.ctx_proj = nn.Linear(DISTILLT5_OUT_DIM, HALIDE_CTX_DIM)
def load(self): from huggingface_hub import hf_hub_download49 unmodified lines
@torch.no_grad()def sample_mica(model: MicaGenerator, text_enc: DistillT5TextEncoder, vae,def sample_halide(model: HalideGenerator, text_enc: DistillT5TextEncoder, vae, prompts: list[str], steps: int = 50, cfg: float = 4.0, shift: float = 2.0, resolution: int = 768, seed: int = 42, device: str = "cuda"):README.md+12-12
config.json+1-1
mica_modeling.py → halide_modeling.pyRenamed+12-12