MOSS-Image Smaller Encoder β€” 0.8B / 2B / 4B to 9B Adapters

An experimental, lightweight text-encoder replacement for MOSS-Image. These adapters map features from a smaller Qwen3.5 encoder (4B, 2B or 0.8B) into the conditioning space of MOSS-Image's original Qwen3.5-9B text encoder. The goal is to reduce memory requirements for prompt encoding while retaining useful image-generation quality.

GitHub β€” ComfyUI node, source code, and installation instructions: bakapotatolord/moss-image-smaller-encoder

All three adapters are fitted on the same 1,600 clean prompts. These are feature-projection adapters, not LoRAs or standalone text-to-image models. Each requires MOSS-Image, the matching Qwen3.5 encoder, and the adapter node. Equivalent quality to the original 9B encoder is not guaranteed.

Which adapter do I need?

Pick the adapter that matches your encoder. An adapter only works with its own encoder size; the node checks this and refuses a mismatch.

Encoder Status Adapter Size Projection
Qwen3.5-4B Recommended moss_qwen35_4b_to_9b_1600_train.safetensors ~21 MB 2,560 β†’ 4,096
Qwen3.5-2B Experimental moss_qwen35_2b_to_9b_1600_train.safetensors ~17 MB 2,048 β†’ 4,096
Qwen3.5-0.8B Experimental moss_qwen35_08b_to_9b_1600_train.safetensors ~8 MB 1,024 β†’ 4,096

Start with 4B: it matches the 9B features most closely and is the only size with image comparisons below. The 2B and 0.8B adapters are for experimentation: they use less memory but reconstruct the 9B features less closely, and their image quality has not been evaluated.

Smaller encoders use less memory but reconstruct the 9B features less closely. 4B is the best-tested option and the only one with image comparisons below.

How it works

The smaller encoder and the 9B encoder remain frozen. The same prompts are encoded using MOSS's prompt template, and token-aligned, final normalized hidden states are collected from both encoders.

A standardized affine projection is fitted using token-weighted ridge regression to approximate the 9B features from the smaller encoder's features. Neither encoder nor the diffusion model is fine-tuned.

Component Details
Student encoders Qwen3.5-4B, Qwen3.5-2B or Qwen3.5-0.8B
Target encoder MOSS-Image's original Qwen3.5-9B
Projection parameters About 10.5 M (4B), 8.4 M (2B), 4.2 M (0.8B)
Stored tensors FP16 projection matrix and FP32 normalization statistics
Fitting method Standardized, token-weighted ridge regression
ComfyUI projection CPU FP32 computation with FP16 output rounding

Only the projection adapters are distributed here. The Qwen encoder and MOSS-Image model weights must be downloaded separately.

Current results β€” 1,600 fitting prompts

The adapters use a 2,400-prompt dataset, divided into:

Split SFW prompts Adult/NSFW prompts Total
Training 800 800 1,600
Validation 200 200 400
Held-out test 200 200 400

Only the 1,600 training prompts were used to fit each projection. Validation selected the ridge regularization strength, and the separate test set measured feature reconstruction. Embedded LoRA and hypernetwork invocation tags were removed before feature collection. The test corpus has been examined in earlier experiments.

The mixed corpus includes prompts from jtatman/stable-diffusion-prompts-stats-full-uncensored. SFW/adult categories are based on source labels and text screening; they are not independently verified semantic annotations. Equal prompt counts also do not imply equal token contributions to the fit.

Feature reconstruction

Encoder Test prompts Content-token relative L2 error ↓ Content-token cosine similarity ↑
Qwen3.5-4B 400 0.4042 0.9126
Qwen3.5-2B 408 0.4590 0.8855
Qwen3.5-0.8B 408 0.5038 0.8611

The 2B and 0.8B adapters were measured on a 408-prompt held-out test set from the same fitting run, so compare them with 4B only approximately.

For 4B, on the same 400 test prompts, the earlier clean 800-prompt ridge scored 0.4132 relative L2 and 0.9086 cosine similarity. Expanding to 1,600 fitting prompts reduced relative L2 error by 2.17%, with improvements in both SFW and adult-source groups.

These metrics measure how closely projected features approximate the original 9B features. They are not image-quality scores, and a small numerical difference does not guarantee visibly better or worse images on every prompt.

Image comparisons (4B)

The single grid below contains six image pairs, with original 9B on the left and projected 4B using the 1,600-prompt ridge adapter on the right. No image comparisons are published yet for 2B or 0.8B.

  • Portrait and watercolor boats: two held-out SFW prompts, each shown at seeds 2026101801 and 2026101802. The projected-4B images were freshly rendered; the original 9B references were reused after checking prompt, seed, noise hash, model/LoRA/VAE identity, runtime and image hashes.
  • Artichoke railway and glassblower: two newly written SFW prompts, each shown at seed 2026101907. Neither has an exact or substantial substring match in the 2,400-prompt corpus, and each scene's distinctive terms are absent. Generic vocabulary may overlap; absence from encoder pretraining was not assessed.

Every pair uses matching prompts, seeds, initial noise and generation settings:

  • Resolution: 640 Γ— 960
  • Sampling: 8 steps, Euler / simple
  • CFG: 1
  • Sampling shift: 5
  • MOSS Image 8-step DMD LoRA strength: 0.8

Original 9B versus projected 4B with the 1,600-prompt ridge adapter: six matched image pairs

Click the grid to view the full-resolution 1280 Γ— 6240 image. Full prompts and generation details are also available in the GitHub comparison manifest.

The examples retain the main subjects and artistic styles, with differences in composition, geometry, and incidental details. They do not establish quality parity with the original encoder.

Adult prompts were included in fitting and feature evaluation, but adult image-generation quality has not been visually evaluated. Quality with other encoder quantizations, longer prompts, image editing, higher CFG, and other generation settings also remains unestablished.

Models and usage

Original MOSS-Image models

Smaller encoder

Tested checkpoints, all INT8 ConvRot:

Your ComfyUI installation must support Qwen3.5 text encoders and the INT8 ConvRot quantization format.

Use Qwen3.5, not Qwen3-VL. These are different model families.

Download the adapters

All three adapters are in this repository and in the GitHub release. Download only the one that matches your encoder.

Adapter SHA-256 checksums
df5ed7fa15f4c628ad6cb3539d9cd16d68f198df9cd1e07740e9bd7b162c954b  moss_qwen35_4b_to_9b_1600_train.safetensors
87a23bac3e1714934bc33654ec53a33839d356ad2295f2d3563b8fe21fcdddee  moss_qwen35_2b_to_9b_1600_train.safetensors
e6c8d748c456916183f2179a73b72a0d01ce9c404d4246ff6ab084ef6f52006b  moss_qwen35_08b_to_9b_1600_train.safetensors

ComfyUI setup

  1. Install or update moss-image-smaller-encoder in ComfyUI/custom_nodes/. 2B and 0.8B support requires the latest version.
  2. Place the Qwen3.5 checkpoint in ComfyUI/models/text_encoders/.
  3. Place the matching adapter in ComfyUI/models/moss_encoder_adapters/.
  4. Restart ComfyUI.
  5. Select the Qwen3.5 checkpoint in Load CLIP, with type set to moss_image.
  6. Add MOSS Smaller Encoder Adapter, select the matching adapter file, and connect its CLIP output to the normal CLIP Text Encode node.

Load CLIP β†’ Load LoRA (optional) β†’ MOSS Smaller Encoder Adapter β†’ CLIP Text Encode β†’ KSampler

Keep your usual MOSS diffusion-model and VAE connections. The GitHub repository includes a sample workflow and further compatibility details.

The adapter cannot be loaded through a LoRA loader, and it does not replace the complete text encoder.

Development approach

This project is vibe coded-ish: AI assists with research, implementation, and experiments, while I review the proposed steps, verify the work, and inspect the results. The evaluation limits are documented above.

Credits and references

This is an independent community experiment and is not affiliated with the OpenMOSS, Qwen, or ComfyUI-ClipProj developers. Refer to the licenses of the original models, datasets, and software separately.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for PotatoForge/moss-image-4b-encoder-adapter

Adapter
(100)
this model