MOSS-Image-SFT-Turbo

Experimental model files for ComfyUI and others, mainly created for testing in Radiant Canvas for fast macOS inference (https://apps.apple.com/us/app/radiant-canvas-ai-image-gen/id6802973075).

A fast 8-step variant of OpenMOSS-Team/MOSS-Image-SFT.

Use CFG 1 and 8 steps. No negative prompt is used.

Files

  • diffusion_models/moss_image_sft_turbo_int8_convrot.safetensors: the diffusion transformer as a single file in ComfyUI's native INT8 ConvRot format.
  • sampler/moss_image_sft_turbo_sampler.safetensors: the turbo sampler parameters, latent_mix.Q ([128, 128]) and step_codes (8 timesteps).

For ComfyUI, place the model file in:

ComfyUI/models/diffusion_models/

ComfyUI support comes from the MOSS-Image plugin (search for MOSS-Image in ComfyUI Manager, or see the ComfyUI guide). You need a ComfyUI build with INT8 ConvRot support. The text encoder and VAE are the same as MOSS-Image-SFT's and are not included here.

Sampling

The model is meant for the turbo sampler below, not a standard flow-matching schedule. Every step starts from the same initial noise z, mixed with the previous clean estimate through Q, and the model is given the step code as its timestep:

from safetensors.torch import load_file

s = load_file("sampler/moss_image_sft_turbo_sampler.safetensors")
Q, codes = s["latent_mix.Q"], s["step_codes"]
z = torch.randn(1, 128, height // 16, width // 16)   # float32
x0 = torch.zeros_like(z)
for r in range(8):
    x = z + torch.einsum("oc,bchw->bohw", Q, x0)
    v = transformer(x, codes[r], prompt_embeds, prompt_mask)  # CFG 1
    x0 = z - v
# decode x0 with the MOSS-Image VAE

Fewer than 8 steps also work, with some loss of detail. Running the model with a standard ComfyUI sampler at 8 steps and CFG 1 is not equivalent to this loop.

Precision

  • The 252 attention and MLP block weights are INT8 ConvRot (per-channel scale, ConvRot group size 256), quantized from FP32 weights.
  • The time embedding and the shared and head modulation biases are kept in FP32. Keep these in FP32 when converting the file.
  • rope.bands is FP32. All other tensors are BF16.

This is an experimental release. Check output quality for your own prompts before relying on it.

License

Released under the Apache License 2.0. This is a modified version of MOSS-Image-SFT by OpenMOSS, which is also licensed under the Apache License 2.0. A copy of the license is included in this repository.

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for toxicdog/MOSS-Image-SFT-Turbo-INT8-ConvRot

Finetuned
(3)
this model