Nodes/agate-comfyui/Agate Sampler
ComfyUI Node

Agate Sampler

A 260M model that speaks SD 1.5's latent language

By logolabs·Created about 15 hours ago·Updated about 12 hours ago· 0
Agate Sampler
  • agate
  • latent_image
  • latent
◄prompta minimalist logo of a fox head, orange, flat design, white background►
◄negative_prompt►
◄seed0►
◄steps50►
◄cfg3.0►
◄autoguide0.0►
◄batch_size1►
◄denoise1.00►
◄live_previewside_by_side►

Here's what makes Agate more than a curiosity: it samples in SD 1.x's latent space - the same unscaled 4-channel latents that stock VAE Encode emits and VAE Decode consumes, 4 × 32 × 32 for a 256 px image. A 260M model trained from scratch in 145 GPU-hours drops straight into your existing decode, save, upscale and img2img plumbing.

What that doesn't mean is that KSampler can run it. Agate isn't a diffusion UNet and doesn't predict noise; Agate Sampler is its own sampler, and steps and CFG live here, not in a KSampler.

How it works

Agate is a rectified flow model: a near-straight path from noise at t = 0 to the image at t = 1, with the model predicting a velocity along it. Agate Sampler walks that path with plain Euler steps, z = z + dt·v, which is why there's no scheduler dropdown anywhere in this pack. No Karras, no exponential, no shift - the flow-matching scheduling traps that bite other modern models can't bite you here, because you don't get to pick. The generator is a 191M "thinker-steered" convolutional flow model: a thinker writes a layout map, a renderer paints from it.

Every step runs the model twice, once on your prompt and once on the negative, combined as vu + cfg·(vc − vu) - the usual classifier-free guidance arithmetic, the usual doubled cost per step. Prompts go through a fine-tuned Ettin-68M (ModernBERT) encoder, reading up to 512 tokens.

The inputs you'll actually touch

prompt is plain English, and the default is the pack's own example - "a minimalist logo of a fox head, orange, flat design, white background" - a fair hint at the model's happy place: flat design, logos, one or two clean subjects. negative_prompt defaults empty and genuinely should stay empty, because Agate was trained with the empty prompt on the unconditional side. It isn't a box you fill with "worst quality".

steps 50 and cfg 3.0 are the defaults because they're the recommendation. 30 steps is a real draft setting - on the author's four-prompt check it held the composition of the 50-step image at 60% of the time. Below 15–20, images stay clean but the layout drifts from what 50 steps would have given you, which hurts more than a little softness when you're seed-hunting. And cfg wants to be low; 7 will simply burn it.

autoguide is the interesting knob. Above 0, the sampler also steers away from Agate's own early checkpoint (step 27,600) instead of only away from the negative prompt, which sharpens faces and fine detail. Try 1.0 with cfg 4. It costs about 50% more time and loads the guide model (+0.5 GB) on first use.

seed has the usual control_after_generate dropdown and the usual trap: it fires after the run, so the number in the box is next run's, not the one that just made the image you like.

batch_size is images per run from a single seed, and connecting latent_image overrides it - the latent's batch wins.

live_preview picks what shows on the node while it samples: side_by_side (the default - developing image next to the thinker's 16 × 16 plan), image, plan, or none.

Then denoise and the optional latent_image, which are one feature wearing two widgets. With a latent connected, sampling starts at t = 1 − denoise rather than from pure noise: at 1.0 the latent's content is ignored (plain txt2img), and lower values keep more of it. Load Image → VAE Encode → Agate Sampler at denoise 0.6 re-renders an existing picture - layout and colours survive, your prompt rewrites the details. Feed an Agate latent back in at a low denoise and you get variations of it. You need a real SD 1.x latent here (4 channels or it throws), and it warns if the size isn't 32 × 32, because Agate was trained at 256 px and nothing else.

The output

One: latent. Wire it into stock VAE Decode with an SD 1.5 VAE - vae-ft-mse-840000-ema-pruned matches what Agate was trained against, and it's the right answer on SD 1.5 lineage for the boring reason that it's what most things were trained against. Then Save Image, an upscaler, or another sampler.

Installing it

cd ComfyUI/custom_nodes
git clone https://github.com/logolabs/agate-comfyui
pip install -r agate-comfyui/requirements.txt

ComfyUI Manager works too - search Agate, install, restart. That gets you diffusers>=0.30 and transformers>=4.48 (ModernBERT, for the text encoder) and leaves torch alone. Nodes appear under LogoLabs → Agate, and agate_txt2img.json in the pack's example_workflows/ is the whole graph: Loader → Sampler → VAE Decode → Save Image. The 522 MB checkpoint auto-downloads into models/agate/; the repo is public.

Resolution, and calibrating expectations

256 px is native. Bigger latents run - sides divisible by 32 px - but they're out of distribution, so expect weirdness rather than more detail. Upscale afterwards instead: Upscale Image By at 4× lanczos is cheap, predictable and honest about adding no content, while an ESRGAN-type 4× model gives sharper line work. On flat, logo-ish output lanczos is underrated - there's very little there for a generative upscaler to invent.

And keep expectations calibrated on the model itself. It's a research preview and not yet converged: exact text, counting above three, and negation are all bad, so "a bowl with no fruit" comes back full of fruit. "Why did my first Agate image take 27 seconds" is also the predictable first post - the first run after starting ComfyUI loads weights, picks cuDNN kernels and records the CUDA graph, which is 26–28 seconds on the author's 4060. Once per session, not a hang.

CategoryLogoLabs/Agate

Inputs (11)

NameTypeDefaultDescription
agateAGATE_MODEL—
promptSTRINGa minimalist logo of a fox head, orange, flat design, white background—
negative_promptSTRINGThe unconditional prompt for CFG; empty is what Agate was trained with
seedINT00–18446744073709550000—
stepsINT501–200—
cfgFLOAT3.00–20—
autoguideFLOAT0.00–3Also steer away from Agate's early (step 27,600) checkpoint: sharper faces and detail. Try 1.0 with cfg 4. ~50% slower; loads the guide model (+0.5 GB) on first use.
batch_sizeINT11–64Ignored when latent_image is connected (its batch is used)
denoiseFLOAT1.000–11.0: ignore latent_image's content (txt2img). Lower keeps more of latent_image: sampling starts at t = 1 - denoise.
live_previewCOMBOside_by_sideLive preview on this node during sampling: side_by_side shows both the developing image and the thinker's 16x16 plan.
latent_imageoptLATENT—

Outputs (1)

NameTypeDescription
latentLATENT—