CoolFace
Modelpublic

humbleakh/stable-diffusion-4bit-chain-of-zoom

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
0likes4downloads
Model Card

Stable Diffusion 4-bit Quantized for Chain-of-Zoom

๐Ÿ“‹ Model Description

4-bit quantized Stable Diffusion components optimized for super-resolution

This model is part of the Chain-of-Zoom 4-bit Quantized Pipeline - a memory-optimized version of the original Chain-of-Zoom super-resolution framework.

๐ŸŽฏ Key Features

  • โ€”4-bit Quantization: Uses BitsAndBytes NF4 quantization for 75% memory reduction
  • โ€”Maintained Quality: Comparable performance to full precision models
  • โ€”Google Colab Compatible: Runs on T4 GPU (16GB VRAM)
  • โ€”Memory Efficient: Optimized for low-resource environments

๐Ÿ“Š Quantization Details

  • โ€”Method: BitsAndBytes NF4 4-bit quantization
  • โ€”Compute dtype: bfloat16/float16
  • โ€”Double quantization: Enabled
  • โ€”Memory reduction: ~75% compared to original
  • โ€”Original memory: ~12GB โ†’ Quantized: ~3GB

๐Ÿš€ Usage

python
# Install required packages
pip install transformers accelerate bitsandbytes torch

# Load quantized model
from transformers import BitsAndBytesConfig
import torch

# 4-bit quantization config
bnb_config = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_quant_type="nf4",
    bnb_4bit_use_double_quant=True,
    bnb_4bit_compute_dtype=torch.bfloat16
)

# Model-specific loading code here
# (See complete notebook for detailed usage)

๐Ÿ“ˆ Performance

  • โ€”Quality: Maintained performance vs full precision
  • โ€”Speed: 2-3x faster inference
  • โ€”Memory: 75% reduction in VRAM usage
  • โ€”Hardware: Compatible with T4, V100, A100 GPUs

๐Ÿ”ง Technical Specifications

  • โ€”Created: 2025-06-08 16:30:09
  • โ€”Quantization Library: BitsAndBytes
  • โ€”Framework: PyTorch + Transformers
  • โ€”Precision: 4-bit NF4
  • โ€”Model Size: 0.00017261505126953125 MB

๐Ÿ“ Citation

bibtex
@misc{chain-of-zoom-4bit-diffusion,
  title={Chain-of-Zoom 4-bit Quantized Stable Diffusion 4-bit Quantized for Chain-of-Zoom},
  author={humbleakh},
  year={2024},
  publisher={Hugging Face},
  url={https://huggingface.co/humbleakh/stable-diffusion-4bit-chain-of-zoom}
}

๐Ÿ”— Related Models

โš ๏ธ Limitations

  • โ€”Requires BitsAndBytes library for proper loading
  • โ€”May have slight quality differences compared to full precision
  • โ€”Optimized for inference, not fine-tuning

๐Ÿ“„ License

Apache 2.0 - See original model licenses for specific components.