Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Studio: neutral NVFP4 gate field names and refreshed checkpoint hashes (#17469)
Daniel Han4e17a32b60fb
diff --git a/studio/backend/core/inference/diffusion_nvfp4_gate.py b/studio/backend/core/inference/diffusion_nvfp4_gate.pyindex 8fb9a6eff48..5197232a6df 100644--- a/studio/backend/core/inference/diffusion_nvfp4_gate.py+++ b/studio/backend/core/inference/diffusion_nvfp4_gate.py@@ -13,11 +13,14 @@ GATE_RECORD_VERSION = 1GATE_RECORD_PATH = Path(__file__).with_name("nvfp4_gate_record.json")+# The gated build's variant flag, recorded for reference; no loader decision reads it.+REFINED_FIELD = "refined"+RECORD_KEY_FIELDS = ("family", "base_repo", "policy_id", "policy_version", "checkpoint_sha256")RECORD_FIELDS = RECORD_KEY_FIELDS + ("repo_id","filename",- "gptq",+ REFINED_FIELD,"all_pass","num_pairs","num_passed",@@ -31,7 +34,6 @@ RECORD_FIELDS = RECORD_KEY_FIELDS + ("versions","gate_script_sha256","run_date",- "results_path",)_CACHE: dict[tuple, tuple] = {}diff --git a/studio/backend/core/inference/diffusion_nvfp4_policy.py b/studio/backend/core/inference/diffusion_nvfp4_policy.pyindex c9672c45e64..98a522007e0 100644--- a/studio/backend/core/inference/diffusion_nvfp4_policy.py+++ b/studio/backend/core/inference/diffusion_nvfp4_policy.py@@ -300,8 +300,9 @@ def policy_metadata(assignment: Mapping,*,activation_scales_baked: bool = False,- gptq: bool = False,+ refined: bool = False,) -> dict:+ from .diffusion_nvfp4_gate import REFINED_FIELDcounts = Counter(assignment.values())return {NVFP4_POLICY_KEY: {@@ -313,7 +314,7 @@ def policy_metadata(fqn for fqn, precision in assignment.items() if precision == PRECISION_NVFP4),"activation_scales_baked": bool(activation_scales_baked),- "gptq": bool(gptq),+ REFINED_FIELD: bool(refined),}}diff --git a/studio/backend/core/inference/flux3_prompt_upsampler.py b/studio/backend/core/inference/flux3_prompt_upsampler.pyindex fd731f6f611..f273b33b6a5 100644--- a/studio/backend/core/inference/flux3_prompt_upsampler.py+++ b/studio/backend/core/inference/flux3_prompt_upsampler.py@@ -34,8 +34,8 @@ UPSAMPLER_MODEL_FILES = {"Q4_K_M": "flux-3-image-klein-pup-Q4_K_M.gguf","Q8_0": "flux-3-image-klein-pup-Q8_0.gguf",}-# Unsloth Dynamic 4-bit with an imatrix: against BF16 on the upsampler's own captions, about 39% lower mean KL-# divergence than the imatrix Q4_K_M for 6% more bytes, at the same speed.+# Unsloth Dynamic 4-bit: against BF16 on the upsampler's own captions, about 39% lower mean KL divergence than+# Q4_K_M for 6% more bytes, at the same speed.UPSAMPLER_DEFAULT_QUANT = "UD-Q4_K_XL"UPSAMPLER_MODEL_FILE = UPSAMPLER_MODEL_FILES[UPSAMPLER_DEFAULT_QUANT]# What a run reads, best first: an install holding Q4_K_M (the default until UD-Q4_K_XL) keeps enhancing offline.diff --git a/studio/backend/core/inference/nvfp4_gate_record.json b/studio/backend/core/inference/nvfp4_gate_record.jsonindex 4f8455e6abb..78935f657e7 100644--- a/studio/backend/core/inference/nvfp4_gate_record.json+++ b/studio/backend/core/inference/nvfp4_gate_record.json@@ -7,10 +7,10 @@"base_repo": "Tongyi-MAI/Z-Image-Turbo","policy_id": "zimg_rg76_v1","policy_version": 1,- "checkpoint_sha256": "0762fa96e1048c8c7732dae0a168f5df952808f76ffa5621a6dc2d27007e453c",+ "checkpoint_sha256": "4de8a09d27d8e6d43687f9eefaabfc638778984f1fb6cc556de80381189eebfa","repo_id": "unsloth/Z-Image-Turbo-NVFP4","filename": "Z-Image-Turbo-NVFP4.safetensors",- "gptq": true,+ "refined": true,"all_pass": true,"num_pairs": 24,"num_passed": 24,@@ -51,7 +51,6 @@},"gate_script_sha256": "d0b423658874f8430b1508f839cbc7fe39b1ee04d73931ffe4f24c444b11d3b5","run_date": "2026-09-24",- "results_path": "/mnt/disks/unslothai/ubuntu/workspace_81/outputs/nvfp4_repick/zimg_zimg_rg76_v1_g32/gate/results.json","fp8_paired": {"metric": "lpips_vgg(nvfp4, bf16) - lpips_vgg(fp8, bf16), per (prompt, seed)","prompts": "diffusion_bench image_24 (24 frozen prompts)",@@ -87,10 +86,10 @@"base_repo": "Qwen/Qwen-Image-2.1","policy_id": "qwen21_r020_v1","policy_version": 1,- "checkpoint_sha256": "6656d1a0c442692f51e1b0ff81e23a0c6f3f693911e13a44035ab100b80f54c0",+ "checkpoint_sha256": "39ed651bf6c7cab0ca9564c2022c98e232b0647cecb2bc7aba7fb88b1a4553b1","repo_id": "unsloth/Qwen-Image-2.1-NVFP4","filename": "Qwen-Image-2.1-NVFP4.safetensors",- "gptq": true,+ "refined": true,"all_pass": true,"num_pairs": 28,"num_passed": 28,@@ -131,7 +130,6 @@},"gate_script_sha256": "d0b423658874f8430b1508f839cbc7fe39b1ee04d73931ffe4f24c444b11d3b5","run_date": "2026-09-24",- "results_path": "/mnt/disks/unslothai/ubuntu/workspace_81/outputs/nvfp4_repick/q21_qwen21_r020_v1_g32/gate/results.json","fp8_paired": {"metric": "lpips_vgg(nvfp4, bf16) - lpips_vgg(fp8, bf16), per (prompt, seed)","prompts": "diffusion_bench image_24 (24 frozen prompts)",@@ -167,10 +165,10 @@"base_repo": "black-forest-labs/FLUX.1-schnell","policy_id": "flux_r420_v1","policy_version": 1,- "checkpoint_sha256": "b8d92016e8a6b6274c6fb5244edf47fc9b646adc0535aa19f477a5396e72e7bc",+ "checkpoint_sha256": "0be538dda7e7b22dfccff47476e80618d8166c26159cc6baf6334bba82d6fbb7","repo_id": "unsloth/FLUX.1-schnell-NVFP4","filename": "FLUX.1-schnell-NVFP4.safetensors",- "gptq": true,+ "refined": true,"all_pass": true,"num_pairs": 24,"num_passed": 24,@@ -211,7 +209,6 @@},"gate_script_sha256": "d0b423658874f8430b1508f839cbc7fe39b1ee04d73931ffe4f24c444b11d3b5","run_date": "2026-09-24",- "results_path": "/mnt/disks/unslothai/ubuntu/workspace_81/outputs/nvfp4_repick/flux_flux_r420_v1_g32/gate/results.json","fp8_paired": {"metric": "lpips_vgg(nvfp4, bf16) - lpips_vgg(fp8, bf16), per (prompt, seed)","prompts": "diffusion_bench image_24 (24 frozen prompts)",@@ -247,10 +244,10 @@"base_repo": "Qwen/Qwen-Image-2512","policy_id": "qwen2512_m120_attn8_v1","policy_version": 1,- "checkpoint_sha256": "0d3720a478323ec5592a56d7e27af75bac7d3f115beeffceb3488d1ca9755ec3",+ "checkpoint_sha256": "42de65274b0829dadefb4bda5ae2c44356c654ec80f781c5edc7ec2d2a398e1c","repo_id": "unsloth/Qwen-Image-2512-NVFP4","filename": "Qwen-Image-2512-NVFP4.safetensors",- "gptq": true,+ "refined": true,"all_pass": true,"num_pairs": 28,"num_passed": 28,@@ -291,7 +288,6 @@},"gate_script_sha256": "d0b423658874f8430b1508f839cbc7fe39b1ee04d73931ffe4f24c444b11d3b5","run_date": "2026-09-24",- "results_path": "/mnt/disks/unslothai/ubuntu/workspace_81/outputs/nvfp4_repick/q2512_qwen2512_m120_attn8_v1_g32/gate/results.json","fp8_paired": {"metric": "lpips_vgg(nvfp4, bf16) - lpips_vgg(fp8, bf16), per (prompt, seed)","prompts": "diffusion_bench image_24 (24 frozen prompts)",diff --git a/studio/backend/core/inference/video_families.py b/studio/backend/core/inference/video_families.pyindex 8fab2605e09..91055ac719f 100644--- a/studio/backend/core/inference/video_families.py+++ b/studio/backend/core/inference/video_families.py@@ -488,16 +488,16 @@ _HUNYUAN15_INT8_EXCLUDES = ()# Measured failing the NVFP4 accuracy gate (LPIPS mean vs bf16 <= 0.25), so nvfp4 is denied outright, as the image# families deny an ungated base. HunyuanVideo-1.5: hosted 480p / 720p 0.62 / 0.59 (Studio main, 20 steps); the 50-step-# campaign put GPTQ NVFP4 at 0.44 and fp8 itself at 0.35 to 0.37, so no NVFP4 rebuild clears the bar.+# campaign put the best NVFP4 rebuild at 0.44 and fp8 itself at 0.35 to 0.37, so no NVFP4 rebuild clears the bar.# Wan2.2-TI2V-5B: hosted 0.29; weight-only 4-bit (bf16 activations) is already 0.29 at the default grid, and the# layer keep-sets that come near 0.25 save about 10% of fp8's bytes, where fp8 (0.17) already passes._NVFP4_GATE_FAILED = frozenset({"nvfp4"})# What a refused explicit nvfp4 request says for those families: measured and failed, not merely unmeasured.NVFP4_GATE_FAILURES: dict[str, str] = {"hunyuanvideo-1.5": "the hosted NVFP4 build measured LPIPS 0.62 against bf16 (bar 0.25), and no NVFP4 rebuild "- "clears it: GPTQ reached 0.44 and fp8 itself 0.35 to 0.37",- "hunyuanvideo-1.5-720p": "the hosted NVFP4 build (RTN) measured LPIPS 0.59 against bf16 (bar 0.25), and no NVFP4 "- "rebuild clears it: on the 480p weights GPTQ reached 0.44 and fp8 itself 0.35 to 0.37",+ "clears it: the best rebuild reached 0.44 and fp8 itself 0.35 to 0.37",+ "hunyuanvideo-1.5-720p": "the hosted NVFP4 build measured LPIPS 0.59 against bf16 (bar 0.25), and no NVFP4 "+ "rebuild clears it: on the 480p weights the best rebuild reached 0.44 and fp8 itself 0.35 to 0.37","wan2.2-ti2v-5b": "the hosted NVFP4 build measured LPIPS 0.29 to 0.30 against bf16 (bar 0.25); weight-only 4-bit is ""already 0.29, while fp8 passes at 0.17",}@@ -988,7 +988,7 @@ _FAMILIES: tuple[VideoFamily, ...] = (transformer_class = "HunyuanVideo15Transformer3DModel",base_repo = "hunyuanvideo-community/HunyuanVideo-1.5-Diffusers-720p_t2v",unsupported_checkpoints = ((_HV15_I2V_RE, _HV15_I2V_REFUSAL),),- # RTN, not GPTQ: the 720p transformer is separately trained; 480p corrections do not apply.+ # The 720p transformer is separately trained, so it ships its own plain NVFP4 build.prequant_repos = (("nvfp4", "unsloth/HunyuanVideo-1.5-NVFP4"),),prequant_filenames = (("nvfp4", "HunyuanVideo-1.5-Diffusers-720p_t2v-NVFP4.safetensors"),),prequant_resident_gb_by_scheme = (("nvfp4", 4.8),),diff --git a/studio/backend/tests/test_diffusion_nvfp4_gate.py b/studio/backend/tests/test_diffusion_nvfp4_gate.pyindex 227a43bff21..16ecb4ee475 100644--- a/studio/backend/tests/test_diffusion_nvfp4_gate.py+++ b/studio/backend/tests/test_diffusion_nvfp4_gate.py@@ -16,6 +16,7 @@ from core.inference.diffusion_nvfp4_gate import (GATE_RECORD_PATH,GATE_RECORD_VERSION,RECORD_KEY_FIELDS,+ REFINED_FIELD,load_gate_records,nvfp4_gate_backend,nvfp4_gate_backends,@@ -36,7 +37,7 @@ def _record(**overrides):"checkpoint_sha256": "a" * 64,"repo_id": "unsloth/Z-Image-Turbo-NVFP4","filename": "Z-Image-Turbo-NVFP4.safetensors",- "gptq": False,+ "refined": False,"all_pass": True,"num_pairs": 28,"num_passed": 28,@@ -141,7 +142,7 @@ def test_two_artifacts_gated_on_different_backends_both_read_as_covered(tmp_pathpath = _gate_file(tmp_path,_record(),- _record(checkpoint_sha256 = "b" * 64, gptq = True, backend = "torchao"),+ _record(checkpoint_sha256 = "b" * 64, refined = True, backend = "torchao"),)assert nvfp4_gate_backends("z-image", ZIMAGE_BASE, path = path) == ("flashinfer", "torchao")assert nvfp4_gate_backends("Z-Image", ZIMAGE_BASE, path = path) == ("flashinfer", "torchao")@@ -236,3 +237,24 @@ def test_a_rewritten_file_is_re_read_rather_than_served_from_the_cache(tmp_path)assert nvfp4_gate_passed("z-image", ZIMAGE_BASE, path = path) is False_gate_file(tmp_path, _record())assert nvfp4_gate_passed("z-image", ZIMAGE_BASE, path = path) is True+++def _string_values(value):+ if isinstance(value, dict):+ for item in value.values():+ yield from _string_values(item)+ elif isinstance(value, list):+ for item in value:+ yield from _string_values(item)+ elif isinstance(value, str):+ yield value+++def test_shipped_records_use_the_current_field_and_name_no_local_path():+ for record in load_gate_records():+ assert REFINED_FIELD in record, record+ assert "results_path" not in record, record+ strings = list(_string_values(record))+ assert not [+ value for value in strings if value.startswith(("/", "~")) or ":\\" in value+ ], recorddiff --git a/studio/backend/tests/test_diffusion_nvfp4_policy.py b/studio/backend/tests/test_diffusion_nvfp4_policy.pyindex fb5c986f954..07219cda350 100644--- a/studio/backend/tests/test_diffusion_nvfp4_policy.py+++ b/studio/backend/tests/test_diffusion_nvfp4_policy.py@@ -528,7 +528,7 @@ def test_the_metadata_block_records_the_set_that_was_built():assert block["counts"] == {BF16: 5, FP8: 195, NVFP4: 76}assert len(block["nvfp4_fqns"]) == 76assert block["nvfp4_fqns"] == sorted(block["nvfp4_fqns"])- assert block["activation_scales_baked"] is False and block["gptq"] is False+ assert block["activation_scales_baked"] is False and block["refined"] is Falseassert declares_policy({"scheme": "nvfp4", **fragment})assert policy_metadata_error({"scheme": "nvfp4", **fragment}) is Noneassert policy_metadata(ZIMG_RG76, assign_precisions(_zimage(), ZIMG_RG76)) == fragment