2i commited on
Commit
48fdf5f
·
1 Parent(s): cf6cdc9

Use bf16 text encoder + bf16 stock fallback: fp8 weights bypass ZeroGPU packing (comfy_kitchen QuantizedTensor) and produce NaN

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -82,13 +82,17 @@ except Exception as exc: # pragma: no cover
82
  # Companion models always pulled from Comfy-Org/Krea-2 (the CivitAI checkpoint
83
  # is UNet-only): (repo_id, subfolder, filename). local_dir = models/ root, so
84
  # the repo subfolder (text_encoders/vae/loras) is replicated under models/.
 
 
 
 
85
  COMPANION_MODELS = [
86
- ("Comfy-Org/Krea-2", "text_encoders", "qwen3vl_4b_fp8_scaled.safetensors"),
87
  ("Comfy-Org/Krea-2", "vae", "qwen_image_vae.safetensors"),
88
  ("Comfy-Org/Krea-2", "loras", "krea2_darkbrush.safetensors"),
89
  ]
90
 
91
- STOCK_UNET = ("Comfy-Org/Krea-2", "diffusion_models", "krea2_turbo_fp8_scaled.safetensors")
92
 
93
  # CivitAI checkpoint (the diffusion model):
94
  # CIVIT_API_KEY secret on the Space (required)
@@ -260,7 +264,7 @@ unet_loader = UNETLoader()
260
  UNET = unet_loader.load_unet(unet_name=UNET_NAME, weight_dtype="default")
261
 
262
  clip_loader = CLIPLoader()
263
- CLIP = clip_loader.load_clip(clip_name="qwen3vl_4b_fp8_scaled.safetensors", type="krea2")
264
 
265
  vae_loader = VAELoader()
266
  VAE = vae_loader.load_vae(vae_name="qwen_image_vae.safetensors")
 
82
  # Companion models always pulled from Comfy-Org/Krea-2 (the CivitAI checkpoint
83
  # is UNet-only): (repo_id, subfolder, filename). local_dir = models/ root, so
84
  # the repo subfolder (text_encoders/vae/loras) is replicated under models/.
85
+ #
86
+ # IMPORTANT: bf16 files only. fp8 models are comfy_kitchen QuantizedTensor
87
+ # objects whose .to("cuda") bypasses ZeroGPU's torch patch, so they are never
88
+ # packed/streamed to VRAM and inference produces NaN. bf16 packs fine.
89
  COMPANION_MODELS = [
90
+ ("Comfy-Org/Krea-2", "text_encoders", "qwen3vl_4b_bf16.safetensors"),
91
  ("Comfy-Org/Krea-2", "vae", "qwen_image_vae.safetensors"),
92
  ("Comfy-Org/Krea-2", "loras", "krea2_darkbrush.safetensors"),
93
  ]
94
 
95
+ STOCK_UNET = ("Comfy-Org/Krea-2", "diffusion_models", "krea2_turbo_bf16.safetensors")
96
 
97
  # CivitAI checkpoint (the diffusion model):
98
  # CIVIT_API_KEY secret on the Space (required)
 
264
  UNET = unet_loader.load_unet(unet_name=UNET_NAME, weight_dtype="default")
265
 
266
  clip_loader = CLIPLoader()
267
+ CLIP = clip_loader.load_clip(clip_name="qwen3vl_4b_bf16.safetensors", type="krea2")
268
 
269
  vae_loader = VAELoader()
270
  VAE = vae_loader.load_vae(vae_name="qwen_image_vae.safetensors")