My NVFP4 image and video generation models
Collection
4 items • Updated
How to use InsecureErasure/Krea2-Turbo-mixed-NVFP4 with Diffusers:
pip install -U diffusers transformers accelerate
import torch
from diffusers import DiffusionPipeline
# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("InsecureErasure/Krea2-Turbo-mixed-NVFP4", torch_dtype=torch.bfloat16, device_map="cuda")
prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipe(prompt).images[0]Mixed 8-bit microscaling quantization of Krea-2-Turbo, generated with convert_to_quant.
comfy-kitchen, Blackwell GPU (RTX 50xx / B100 / B200).
|
|
| NVFP4 | BF16 |
The model weights have been partially quantized to NVFP4 (NVIDIA Floating Point 4-bit) and MXFP8, quantization formats supported on NVIDIA Blackwell architecture GPUs.
The following convert_to_quant parameters where used. This conversion takes about 1 hour on an RTX 5060 TI.
$ convert_to_quant -i krea2_turbo_bf16.safetensors \
--nvfp4 \
--krea2 \
--comfy_quant \
--save-quant-metadata \
--custom-type mxfp8 \
--custom-layers \
"blocks\.(0|1|2|24|25|26)\.attn\.(wq|wk|wv|wo)\.weight|blocks\.(0|1|2|25|26|27)\.attn\.gate\.weight|blocks\.(0|1|2|3|25|26|27)\.mlp\.gate\.weight|txtfusion\.layerwise_blocks\.(0|1)\.attn\.(wq|wk|wv|wo|gate)\.weight|txtfusion\.layerwise_blocks\.(0|1)\.mlp\.gate\.weight|txtfusion\.refiner_blocks\.(0|1)\.attn\.(wq|wk|wv|gate)\.weight|txtfusion\.refiner_blocks\.(0|1)\.mlp\.(gate|up)\.weight|txtfusion\.refiner_blocks\.0\.mlp\.down\.weight" \
--exclude-layers \
"blocks\.27\.attn\.(wq|wk|wv)\.weight|txtfusion\.refiner_blocks\.(0|1)\.attn\.wo\.weight|txtfusion\.refiner_blocks\.1\.mlp\.down\.weight" \
--num-iter 4000 \
--top-p 0.35 \
--calib-samples 8192 \
--scale-optimization iterative \
--scale-refinement 2 \
--extract-lora \
--lora-rank 64 \
--lora-target "attn\.(wo|gate)\.weight|mlp\.(gate|down)\.weight" \
-o krea2_turbo_mixed_nvfp4.safetensors