MOSS-Image SFT 4-Step Distillation LoRA: text-to-image, layout control, editing, and PiD 4× upscaling in one ComfyUI canvas#
This ComfyUI project bundles four task-focused pipelines powered by the MOSS-Image SFT 4-Step Distillation LoRA: classic text-to-image, bounding-box-guided generation, instruction-based image editing, and Pixel Diffusion (PiD) 4× upscaling. It opens with Text to Image enabled; the other three groups are bypassed.
To switch modes, right-click the active outer group and choose Bypass Group Nodes, then right-click the group you want, choose Set Group Nodes to Always, and click Run. Each workflow is wired for fast, consistent results using the LoRA’s distilled 4-step schedule and MOSS’s native text encoder, with an optional prompt upsampler you can toggle per group.
Key models in Comfyui MOSS-Image SFT 4-Step Distillation LoRA workflow#
- MOSS-Image SFT (bf16). The base diffusion model that renders images and provides the FLUX.2 latent space and VAE used across all four workflows. Packaged for ComfyUI in the Comfy-Org distribution. Model card and files
- MOSS-SFT-Distill-4step-LoRA (rank 64). The distilled LoRA that teaches MOSS-Image SFT to produce high-fidelity results in a fixed four-step schedule with low guidance. Keep it at full strength in this graph. Model card and files
- Qwen 3.5 9B (W4A8 GPTQ) text encoder for MOSS-Image. Provides robust language understanding for long captions and also powers the optional prompt upsampler that can author detailed scene descriptions before image generation. Files
- FLUX.2 VAE (small decoder). Encodes and decodes between pixel space and the FLUX.2 latent used by MOSS-Image SFT and by the PiD pathway in this canvas. Files
- MOSS-Image Edit LoRA (rank 64). An official edit adapter for instruction-based, reference-aware edits that preserve content outside the requested change. Files
- Pixel Diffusion Decoder (PiD) FLUX.2 2K→4K v1.5. A decoder that lifts MOSS renders to 4× width and height in a separate four-step pass, using Gemma 2 2B for text conditioning. Comfy-Org PixelDiT package and NVIDIA PiD overview
How to use Comfyui MOSS-Image SFT 4-Step Distillation LoRA workflow#
The canvas contains four independent outer groups. Run one group at a time; Text to Image is active on open. Each group follows the same core idea: author or transform a caption, encode it with MOSS’s text encoder, run the LoRA-tuned four-step sampler without a negative pass, decode with the FLUX.2 VAE, and save the result.
Text to Image#
Enter a descriptive prompt and set your output size (multiples of 16 px). The optional upsampler switch Prompt upsampler: true = on (default off) (ComfySwitchNode (#14)) lets MOSS’s own text encoder expand short prompts into detailed, ready-to-render captions; Prompt used (what MOSS reads) (#15) shows exactly what will be encoded. The model path loads MOSS-Image SFT with the 4-step distillation LoRA, then samples with a schedule matched to the LoRA (MOSS · 4 steps (#37)). The image is decoded with the FLUX.2 VAE and saved in Output (#41).
Layout-Guided Text to Image#
Pick an aspect ratio in Size (the boxes and the image) (#904), then draw boxes and write what belongs in each one in Layout: draw the boxes (#907). The Layout prompt (caption + boxes) (#908) turns your boxes and overall caption into a layout-aware prompt for MOSS, keeping object and text placement consistent. Leave the upsampler switch off here (Prompt upsampler: true = on (default off) (#916)), because rewriting the prompt would drop the structured boxes. The LoRA-tuned four-step path renders the layout and saves the image via Output (#943).
Image Editing#
Upload one photo in Photo to edit (#1806); the node scales a working preview while preserving aspect. Write a single, focused instruction in Edit instruction (the photo as reference) (#1835); the node encodes your instruction together with the photo so the edit LoRA knows what to change and what to preserve. The graph loads MOSS-Image SFT, merges the 4-step distillation LoRA and the official edit LoRA, and samples in four steps without a negative pass. Compare results in Before / after (#1846) and save the edit in Output (the edit) (#1845).
Text to Image + PiD 4× Upscale#
Set the source width, height, a supersampling factor, and your prompt in 0 · Your inputs. MOSS first renders a supersampled draft, which is then downsized and re-encoded with the FLUX.2 VAE to feed PiD. PiD’s four-step decoder with Gemma 2 2B captioning lifts the image to exactly 4× each side, using tiled 4096-px windows when needed; the centre crop ensures the final dimensions are precisely 4× the original. Use this path when you want sharper, cleaner large outputs while keeping composition anchored to the base render.
Key nodes in Comfyui MOSS-Image SFT 4-Step Distillation LoRA workflow#
MOSS 4-step schedule (the LoRA's)(#35) This node pins the exact sigma schedule distilled into the LoRA: 1.0, 0.91, 0.717, 0.024, 0.0. Keep this sequence with the pairedeulersampler to match training; replacing it with an automatic scheduler or a different step count typically reduces fidelity, especially on fine textures and typography.CFG 1: no negative pass(#32) Guidance is set tocfg: 1 with the negative branch disabled, which mirrors the LoRA’s distillation regime. Leave this as-is; enabling a negative pass or using negative text injects behavior the LoRA was not trained for and can dampen detail.Prompt upsampler: true = on (default off)(#14) When switched on, MOSS’s text encoder expands your request into a long, single caption before sampling. Use it for short prompts or very high resolutions to increase specificity; in the Layout group leave it off, because rewriting drops bounding boxes by design.MOSS · 4 steps(#37) The sampler executes the LoRA’s four-step path end to end. If you need variation without changing content, adjust only theSeed · default 4242 (random after each run)node; avoid changing sigma schedules or guidance here unless you also disable the LoRA.Edit instruction (the photo as reference)(#1835) This encoder takes the photo and your instruction together, following the edit LoRA’s expected phrasing. Keep instructions tight and affirmative, for example: “Change only the terracotta-orange ceramic mug to cobalt blue. Keep everything else unchanged.” The closer you stay to that pattern, the more reliably the edit isolates the intended region.PiD Conditioning (the downsized MOSS image)(#2817) Bridges the supersampled MOSS draft to PiD by pairing the FLUX.2 latent with PiD’s positive conditioning. Leavelatent_formatasfluxanddegrade_sigmaat 0 to preserve the draft’s structure; PiD will add high-frequency detail while respecting composition.PiD in 4096-px windows past 4096 (core Context Windows)(#2815) Handles oversized outputs by windowing along the long side. Keep the default 4096 window and standard static schedule; adjust only if you have an uncommon tiling artifact, in which case try increasingcontext_overlapwhile staying under memory limits.
Optional extras#
- Switching modes: right-click the active group, choose Bypass Group Nodes; right-click your target group, choose Set Group Nodes to Always; then Run.
- Prompt length matters at large sizes. If you push beyond training sizes, write detailed captions or enable the upsampler so MOSS-Image SFT 4-Step Distillation LoRA has enough guidance.
- Sizes are multiples of 16 px end to end. If outputs look soft, try increasing the base size or the supersampling factor before PiD rather than adding steps.
- For reproducibility, set seed nodes from
randomizetofixed; for variety, keeprandomizeon and rerun. - Keep the LoRA strength at 1.0 and use the provided four-step schedule and no-negative setup; these choices are integral to the distilled behavior of the MOSS-Image SFT 4-Step Distillation LoRA.
- In the edit workflow, change one idea at a time. Short, specific instructions preserve composition and lighting while producing cleaner, localized edits.
Links to referenced model packages:
- MOSS-Image SFT and components: Comfy-Org/MOSS-Image
- Distilled LoRA: lvladikov/MOSS-SFT-Distill-4step-LoRA
- Pixel Diffusion Decoder and text encoder: Comfy-Org/PixelDiT and nvidia/PiD
Acknowledgements#
This workflow implements and builds upon the following works and resources. We gratefully acknowledge lvladikov for MOSS-SFT-Distill-4step-LoRA (4-step distillation LoRA and source workflows), Comfy-Org for MOSS-Image (SFT and edit LoRA), and Comfy-Org for PixelDiT upscaling models for their contributions and maintenance. For authoritative details, please refer to the original documentation and repositories linked below.
Resources#
- lvladikov/MOSS-SFT-Distill-4step-LoRA
- Hugging Face: lvladikov/MOSS-SFT-Distill-4step-LoRA
- arXiv: 2611.17194
- Comfy-Org/MOSS-Image
- GitHub: Comfy-Org/workflow_templates
- Hugging Face: Comfy-Org/MOSS-Image
- Comfy-Org/PixelDiT
- GitHub: Comfy-Org/workflow_templates
- Hugging Face: Comfy-Org/PixelDiT
Note: Use of the referenced models, datasets, and code is subject to the respective licenses and terms provided by their authors and maintainers.








