Text-to-Image
Diffusers
Safetensors
MOSSImagePipeline
4bit
bitsandbytes
nf4
moss-image
8-bit precision
Instructions to use eramth/MOSS-Image-SFT-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use eramth/MOSS-Image-SFT-4bit with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("eramth/MOSS-Image-SFT-4bit", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
|
Download README.md from eramth/MOSS-Image-SFT-4bit: direct link, hf CLI and curl.
- Browser
- Download file 1.35 kB
-
https://huggingface.co/eramth/MOSS-Image-SFT-4bit/resolve/main/README.md
- Command line
-
hf download hf://eramth/MOSS-Image-SFT-4bit/README.md
-
curl -L -o README.md https://huggingface.co/eramth/MOSS-Image-SFT-4bit/resolve/main/README.md
1.35 kB
| license: apache-2.0 | |
| base_model: OpenMOSS-Team/MOSS-Image-SFT | |
| tags: | |
| - diffusers | |
| - text-to-image | |
| - 4bit | |
| - bitsandbytes | |
| - nf4 | |
| - moss-image | |
| # MOSS-Image-SFT-4bit | |
| This is an optimized 4-bit (NF4) quantized version of [OpenMOSS-Team/MOSS-Image-SFT](https://huggingface.co/OpenMOSS-Team/MOSS-Image-SFT), created for efficient inference on 16GB GPUs (such as NVIDIA Tesla T4, RTX 3080/3090/4080/4090). | |
| ## Quantization Details | |
| - **Text Encoder**: Qwen3.5-9B quantized to 4-bit NF4 via `bitsandbytes` (~5.5 GB). | |
| - **Transformer Backbone**: 5B DiT quantized to 4-bit NF4 with small routing and time-embedding modules preserved in FP16 (~2.6 GB). | |
| - **VAE**: Kept at full precision FP32 (FLUX.2 VAE). | |
| - **Total Footprint**: ~8.5 GB (compressed from ~30 GB, >70% reduction). | |
| - **Compute Precision**: FP16 (optimized for Tesla T4 Tensor Cores). | |
| ## Usage with Diffusers | |
| ```python | |
| import torch | |
| from diffusers import DiffusionPipeline | |
| pipe = DiffusionPipeline.from_pretrained( | |
| "eramth/MOSS-Image-SFT-4bit", | |
| custom_pipeline="pipeline_moss_image", | |
| trust_remote_code=True, | |
| torch_dtype={"default": torch.float16, "vae": torch.float32} | |
| ) | |
| pipe.to("cuda") | |
| prompt = "a photorealistic portrait of an astronaut floating in deep cosmic space" | |
| image = pipe(prompt, height=1024, width=1024, num_inference_steps=25).images[0] | |
| image.save("output.png") | |
| ``` | |