Diffusers
Safetensors
qwen3_vl
qwen
qwen3-vl
text-encoder
vision-encoder
heretic
abliteration
prompt-adherence
Instructions to use catplusplus/Qwen21_Text_Encoder_Heretic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use catplusplus/Qwen21_Text_Encoder_Heretic with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("catplusplus/Qwen21_Text_Encoder_Heretic", 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
Download extras/imagegen_qwen21_nvfp4.sh from catplusplus/Qwen21_Text_Encoder_Heretic: direct link, hf CLI and curl.
- Browser
- Download file 1.56 kB
-
https://huggingface.co/catplusplus/Qwen21_Text_Encoder_Heretic/resolve/main/extras/imagegen_qwen21_nvfp4.sh
- Command line
-
hf download hf://catplusplus/Qwen21_Text_Encoder_Heretic/extras/imagegen_qwen21_nvfp4.sh
-
curl -L -o imagegen_qwen21_nvfp4.sh https://huggingface.co/catplusplus/Qwen21_Text_Encoder_Heretic/resolve/main/extras/imagegen_qwen21_nvfp4.sh
1.56 kB
| # Start ImageEditServer with forged SVDQuant NVFP4 r32 Qwen-Image-2.1 model | |
| # Runs 100% resident in VRAM on GPU 0 with Heretic text encoder by default | |
| # Default: 25 steps, guidance-scale 1.0, port 4500, Text Encoder: Qwen21_Text_Encoder_Heretic | |
| PORT=${1:-4500} | |
| MODEL_DIR="/home/olegk/Nikola/models/Qwen/Qwen-Image-2.1" | |
| OPTIMIZED_MODEL="/home/olegk/Nikola/models/nunchaku-qwen-image-2.1/best_quality_fp4.safetensors" | |
| TEXT_ENCODER=${2:-"/home/olegk/Nikola/models/Qwen21_Text_Encoder_Heretic"} | |
| echo "==========================================================" | |
| echo "Starting ImageEditServer (Qwen-Image-2.1 SVDQuant NVFP4 - Resident VRAM)" | |
| echo "Port: $PORT" | |
| echo "Model: $MODEL_DIR" | |
| echo "Optimized Model: $OPTIMIZED_MODEL" | |
| echo "Text Encoder: $TEXT_ENCODER" | |
| echo "Steps: 25 | Guidance Scale: 1.0 | Resident Mode: True" | |
| echo "==========================================================" | |
| export CUDA_VISIBLE_DEVICES="0" | |
| export PYTORCH_CUDA_ALLOC_CONF="expandable_segments:True" | |
| export PYTHONPATH="/home/olegk/Nikola/packages/nunchaku:/home/olegk/Nikola/packages/deepcompressor:/home/olegk/Nikola:$PYTHONPATH" | |
| cd /auto/home/amano/olegk/Nikola/src/imagegen | |
| EXTRA_ARGS="" | |
| if [ -n "$TEXT_ENCODER" ] && [ "$TEXT_ENCODER" != "none" ]; then | |
| EXTRA_ARGS="--text-encoder $TEXT_ENCODER" | |
| fi | |
| exec /home/olegk/Nikola/.venv/bin/python ImageEditServer.py \ | |
| --host 0.0.0.0 \ | |
| --port "$PORT" \ | |
| --model "$MODEL_DIR" \ | |
| --optimized-model "$OPTIMIZED_MODEL" \ | |
| --backend qwen21-nvfp4 \ | |
| --steps 25 \ | |
| --guidance-scale 1.0 \ | |
| $EXTRA_ARGS | |