Upload ModelOpt NVFP4 checkpoint for SGLang
Browse filesFiles changed (18)
- .gitattributes+2
- README.mdAdded+50
- model_index.jsonAdded+29
- processor/chat_template.jinjaAdded+7
- processor/processor_config.jsonAdded+63
- processor/tokenizer.jsonAdded+3
- processor/tokenizer_config.jsonAdded+16
- scheduler/scheduler_config.jsonAdded+18
- text_encoder/config.jsonAdded+106
- text_encoder/generation_config.jsonAdded+14
- text_encoder/model.safetensorsAdded+3
- tokenizer/chat_template.jinjaAdded+54
- tokenizer/tokenizer.jsonAdded+3
- tokenizer/tokenizer_config.jsonAdded+15
- transformer/config.jsonAdded+60
- transformer/diffusion_pytorch_model.safetensorsAdded+3
- vae/config.jsonAdded+58
- vae/diffusion_pytorch_model.safetensorsAdded+3
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines333435363732 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textprocessor/tokenizer.json filter=lfs diff=lfs merge=lfs -texttokenizer/tokenizer.json filter=lfs diff=lfs merge=lfs -text
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950---license: otherlibrary_name: sglangtags:- sglang- diffusion- modelopt- nvfp4- blackwell- qwen-imagebase_model: Qwen/Qwen-Image-Edit-2511pipeline_tag: image-to-image---
# Qwen Image Edit 2511 ModelOpt NVFP4 for SGLang
This repository contains a full Hugging Face-style SGLang Diffusion checkpoint exported from `Qwen/Qwen-Image-Edit-2511` with NVIDIA ModelOpt NVFP4 quantization support. The checkpoint can be loaded directly with `--model-path` in SGLang; no separate `--transformer-path` override is required.
## Export provenance
The checkpoint was generated on an NVIDIA B200 machine by applying NVIDIA ModelOpt PR #1706 locally (`qwen-image-svdquant-nvfp4-pr`) and exporting a full pipeline directory for SGLang validation.
Export settings:
- Base model: `Qwen/Qwen-Image-Edit-2511`- Pipeline class: `QwenImageEditPlusPipeline`- Quantization recipe: SVDQuant NVFP4 / FP4 export through ModelOpt- Main export flag: `--format fp4`- Calibration: max calibration with 8 representative prompts- Block size: 16- Quantized scope: diffusion transformer blocks- BF16 fallbacks: first two and last two transformer blocks, plus attention quantizers disabled during export- Validation target: NVIDIA B200 / Blackwell using SGLang Diffusion
Validated as a full SGLang Diffusion image-edit checkpoint on B200.
## SGLang usage
```bashsglang generate \ --model-path lmsys/qwen-image-edit-2511-modelopt-nvfp4-sglang \ --prompt "A tiny astronaut reading a book under a glass greenhouse" \ --save-output```
For edit pipelines, pass the normal SGLang Diffusion image-edit inputs in addition to `--model-path lmsys/qwen-image-edit-2511-modelopt-nvfp4-sglang`.
## Notes
This is a performance and integration validation checkpoint for SGLang Diffusion NVFP4 support. Please compare generated images with the corresponding BF16 base model for quality-sensitive use cases.1234567891011121314151617181920212223242526272829{ "_class_name": "QwenImageEditPlusPipeline", "_diffusers_version": "0.37.0", "_name_or_path": "Qwen/Qwen-Image-Edit-2511", "processor": [ "transformers", "Qwen2VLProcessor" ], "scheduler": [ "diffusers", "FlowMatchEulerDiscreteScheduler" ], "text_encoder": [ "transformers", "Qwen2_5_VLForConditionalGeneration" ], "tokenizer": [ "transformers", "Qwen2Tokenizer" ], "transformer": [ "diffusers", "QwenImageTransformer2DModel" ], "vae": [ "diffusers", "AutoencoderKLQwenImage" ]}1234567{% set image_count = namespace(value=0) %}{% set video_count = namespace(value=0) %}{% for message in messages %}{% if loop.first and message['role'] != 'system' %}<|im_start|>systemYou are a helpful assistant.<|im_end|>{% endif %}<|im_start|>{{ message['role'] }}{% if message['content'] is string %}{{ message['content'] }}<|im_end|>{% else %}{% for content in message['content'] %}{% if content['type'] == 'image' or 'image' in content or 'image_url' in content %}{% set image_count.value = image_count.value + 1 %}{% if add_vision_id %}Picture {{ image_count.value }}: {% endif %}<|vision_start|><|image_pad|><|vision_end|>{% elif content['type'] == 'video' or 'video' in content %}{% set video_count.value = video_count.value + 1 %}{% if add_vision_id %}Video {{ video_count.value }}: {% endif %}<|vision_start|><|video_pad|><|vision_end|>{% elif 'text' in content %}{{ content['text'] }}{% endif %}{% endfor %}<|im_end|>{% endif %}{% endfor %}{% if add_generation_prompt %}<|im_start|>assistant{% endif %}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263{ "image_processor": { "data_format": "channels_first", "default_to_square": true, "do_convert_rgb": true, "do_normalize": true, "do_rescale": true, "do_resize": true, "image_mean": [ 0.48145466, 0.4578275, 0.40821073 ], "image_processor_type": "Qwen2VLImageProcessor", "image_std": [ 0.26862954, 0.26130258, 0.27577711 ], "merge_size": 2, "patch_size": 14, "resample": 3, "rescale_factor": 0.00392156862745098, "size": { "longest_edge": 12845056, "shortest_edge": 3136 }, "temporal_patch_size": 2 }, "processor_class": "Qwen2VLProcessor", "video_processor": { "data_format": "channels_first", "default_to_square": true, "do_convert_rgb": true, "do_normalize": true, "do_rescale": true, "do_resize": true, "do_sample_frames": false, "image_mean": [ 0.48145466, 0.4578275, 0.40821073 ], "image_std": [ 0.26862954, 0.26130258, 0.27577711 ], "max_frames": 768, "merge_size": 2, "min_frames": 4, "patch_size": 14, "resample": 3, "rescale_factor": 0.00392156862745098, "return_metadata": false, "size": { "longest_edge": 12845056, "shortest_edge": 3136 }, "temporal_patch_size": 2, "video_processor_type": "Qwen2VLVideoProcessor" }}123version https://git-lfs.github.com/spec/v1oid sha256:1a7aabe7a3b44651592a99607bb33066e6965260336be9218cccd53af161491dsize 1142206012345678910111213141516{ "add_prefix_space": false, "backend": "tokenizers", "bos_token": null, "clean_up_tokenization_spaces": false, "eos_token": "<|im_end|>", "errors": "replace", "is_local": true, "local_files_only": false, "model_max_length": 131072, "pad_token": "<|endoftext|>", "processor_class": "Qwen2VLProcessor", "split_special_tokens": false, "tokenizer_class": "Qwen2Tokenizer", "unk_token": null}123456789101112131415161718{ "_class_name": "FlowMatchEulerDiscreteScheduler", "_diffusers_version": "0.37.0", "base_image_seq_len": 256, "base_shift": 0.5, "invert_sigmas": false, "max_image_seq_len": 8192, "max_shift": 0.9, "num_train_timesteps": 1000, "shift": 1.0, "shift_terminal": 0.02, "stochastic_sampling": false, "time_shift_type": "exponential", "use_beta_sigmas": false, "use_dynamic_shifting": true, "use_exponential_sigmas": false, "use_karras_sigmas": false}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106{ "architectures": [ "Qwen2_5_VLForConditionalGeneration" ], "dtype": "bfloat16", "image_token_id": 151655, "model_type": "qwen2_5_vl", "text_config": { "_name_or_path": "/cpfs01/haoyangzhang/pretrained_weights/Qwen2.5-VL", "architectures": [ "Qwen2_5_VLForConditionalGeneration" ], "attention_dropout": 0.0, "bos_token_id": 151643, "dtype": "bfloat16", "eos_token_id": 151645, "hidden_act": "silu", "hidden_size": 3584, "initializer_range": 0.02, "intermediate_size": 18944, "layer_types": [ "full_attention", "full_attention", "full_attention", "full_attention", "full_attention", "full_attention", "full_attention", "full_attention", "full_attention", "full_attention", "full_attention", "full_attention", "full_attention", "full_attention", "full_attention", "full_attention", "full_attention", "full_attention", "full_attention", "full_attention", "full_attention", "full_attention", "full_attention", "full_attention", "full_attention", "full_attention", "full_attention", "full_attention" ], "max_position_embeddings": 128000, "max_window_layers": 28, "model_type": "qwen2_5_vl_text", "num_attention_heads": 28, "num_hidden_layers": 28, "num_key_value_heads": 4, "pad_token_id": null, "rms_norm_eps": 1e-06, "rope_parameters": { "mrope_section": [ 16, 24, 24 ], "rope_theta": 1000000.0, "rope_type": "default", "type": "default" }, "sliding_window": null, "use_cache": true, "use_sliding_window": false, "vision_token_id": 151654, "vocab_size": 152064 }, "tie_word_embeddings": false, "transformers_version": "5.8.1", "video_token_id": 151656, "vision_config": { "depth": 32, "dtype": "bfloat16", "fullatt_block_indexes": [ 7, 15, 23, 31 ], "hidden_act": "silu", "hidden_size": 1280, "in_channels": 3, "in_chans": 3, "initializer_range": 0.02, "intermediate_size": 3420, "model_type": "qwen2_5_vl_vision", "num_heads": 16, "out_hidden_size": 3584, "patch_size": 14, "spatial_merge_size": 2, "spatial_patch_size": 14, "temporal_patch_size": 2, "tokens_per_second": 2, "window_size": 112 }, "vision_end_token_id": 151653, "vision_start_token_id": 151652, "vision_token_id": 151654}1234567891011121314{ "bos_token_id": 151643, "do_sample": true, "eos_token_id": [ 151645, 151643 ], "pad_token_id": 151643, "repetition_penalty": 1.05, "temperature": 0.1, "top_k": 1, "top_p": 0.001, "transformers_version": "5.8.1"}123version https://git-lfs.github.com/spec/v1oid sha256:26fa644c8e61aa8185da5055b61aa28d6897fee102c2f43173acab657c4257a1size 16584415608123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354{%- if tools %} {{- '<|im_start|>system\n' }} {%- if messages[0]['role'] == 'system' %} {{- messages[0]['content'] }} {%- else %} {{- 'You are a helpful assistant.' }} {%- endif %} {{- "\n\n# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }} {%- for tool in tools %} {{- "\n" }} {{- tool | tojson }} {%- endfor %} {{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}{%- else %} {%- if messages[0]['role'] == 'system' %} {{- '<|im_start|>system\n' + messages[0]['content'] + '<|im_end|>\n' }} {%- else %} {{- '<|im_start|>system\nYou are a helpful assistant.<|im_end|>\n' }} {%- endif %}{%- endif %}{%- for message in messages %} {%- if (message.role == "user") or (message.role == "system" and not loop.first) or (message.role == "assistant" and not message.tool_calls) %} {{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }} {%- elif message.role == "assistant" %} {{- '<|im_start|>' + message.role }} {%- if message.content %} {{- '\n' + message.content }} {%- endif %} {%- for tool_call in message.tool_calls %} {%- if tool_call.function is defined %} {%- set tool_call = tool_call.function %} {%- endif %} {{- '\n<tool_call>\n{"name": "' }} {{- tool_call.name }} {{- '", "arguments": ' }} {{- tool_call.arguments | tojson }} {{- '}\n</tool_call>' }} {%- endfor %} {{- '<|im_end|>\n' }} {%- elif message.role == "tool" %} {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != "tool") %} {{- '<|im_start|>user' }} {%- endif %} {{- '\n<tool_response>\n' }} {{- message.content }} {{- '\n</tool_response>' }} {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %} {{- '<|im_end|>\n' }} {%- endif %} {%- endif %}{%- endfor %}{%- if add_generation_prompt %} {{- '<|im_start|>assistant\n' }}{%- endif %}123version https://git-lfs.github.com/spec/v1oid sha256:6b4360dd6a184650ffc48056c2569bc603f896c5adfe94b10f1c79f809638aa5size 11422166123456789101112131415{ "add_prefix_space": false, "backend": "tokenizers", "bos_token": null, "clean_up_tokenization_spaces": false, "eos_token": "<|im_end|>", "errors": "replace", "is_local": true, "local_files_only": false, "model_max_length": 131072, "pad_token": "<|endoftext|>", "split_special_tokens": false, "tokenizer_class": "Qwen2Tokenizer", "unk_token": null}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960{ "_class_name": "QwenImageTransformer2DModel", "_diffusers_version": "0.37.0", "_name_or_path": "/root/.cache/huggingface/hub/models--Qwen--Qwen-Image-Edit-2511/snapshots/6f3ccc0b56e431dc6a0c2b2039706d7d26f22cb9/transformer", "attention_head_dim": 128, "axes_dims_rope": [ 16, 56, 56 ], "guidance_embeds": false, "in_channels": 64, "joint_attention_dim": 3584, "num_attention_heads": 24, "num_layers": 60, "out_channels": 16, "patch_size": 2, "quantization_config": { "config_groups": { "group_0": { "input_activations": { "dynamic": false, "group_size": 16, "num_bits": 4, "type": "float" }, "targets": [ "Linear" ], "weights": { "dynamic": false, "group_size": 16, "num_bits": 4, "type": "float" } } }, "ignore": [ "img_in", "norm_out*", "proj_out", "time_text_embed*", "transformer_blocks.0*", "transformer_blocks.1.*", "transformer_blocks.58*", "transformer_blocks.59*", "txt_in" ], "producer": { "name": "modelopt", "version": "0.44.0" }, "quant_algo": "NVFP4", "quant_method": "modelopt", "quant_type": "NVFP4" }, "use_additional_t_cond": false, "use_layer3d_rope": false, "zero_cond_t": true}123version https://git-lfs.github.com/spec/v1oid sha256:99430cdbea2fc062ad2ce524fab909c043462b944b33be1751669278fb3a0fe8size 1351239232012345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758{ "_class_name": "AutoencoderKLQwenImage", "_diffusers_version": "0.37.0", "_name_or_path": "/root/.cache/huggingface/hub/models--Qwen--Qwen-Image-Edit-2511/snapshots/6f3ccc0b56e431dc6a0c2b2039706d7d26f22cb9/vae", "attn_scales": [], "base_dim": 96, "dim_mult": [ 1, 2, 4, 4 ], "dropout": 0.0, "input_channels": 3, "latents_mean": [ -0.7571, -0.7089, -0.9113, 0.1075, -0.1745, 0.9653, -0.1517, 1.5508, 0.4134, -0.0715, 0.5517, -0.3632, -0.1922, -0.9497, 0.2503, -0.2921 ], "latents_std": [ 2.8184, 1.4541, 2.3275, 2.6558, 1.2196, 1.7708, 2.6052, 2.0743, 3.2687, 2.1526, 2.8652, 1.5579, 1.6382, 1.1253, 2.8251, 1.916 ], "num_res_blocks": 2, "temperal_downsample": [ false, true, true ], "z_dim": 16}123version https://git-lfs.github.com/spec/v1oid sha256:0c8bc8b758c649abef9ea407b95408389a3b2f610d0d10fcb054fe171d0a8344size 253806966.gitattributes+2
README.mdAdded+50
model_index.jsonAdded+29
processor/chat_template.jinjaAdded+7
processor/processor_config.jsonAdded+63
processor/tokenizer.jsonAdded+3
processor/tokenizer_config.jsonAdded+16
scheduler/scheduler_config.jsonAdded+18
text_encoder/config.jsonAdded+106
text_encoder/generation_config.jsonAdded+14
text_encoder/model.safetensorsAdded+3
tokenizer/chat_template.jinjaAdded+54
tokenizer/tokenizer.jsonAdded+3
tokenizer/tokenizer_config.jsonAdded+15
transformer/config.jsonAdded+60
transformer/diffusion_pytorch_model.safetensorsAdded+3
vae/config.jsonAdded+58
vae/diffusion_pytorch_model.safetensorsAdded+3