Release 1.0.3: graceful FP8 text-encoder error
Catch the cryptic "add_stub not implemented for Float8_e4m3fn" crash (a ComfyUI core bug in the Qwen3-VL vision pos-embed when the text encoder is FP8 and an image is used) and raise an actionable message telling the user to load a bf16/fp16 Qwen3-VL-4B encoder. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
9bede2cbc5
commit
8392f7096c
@@ -177,7 +177,22 @@ class TextEncodeKrea2:
|
||||
template = ("<|im_start|>system\n" + system + "<|im_end|>\n"
|
||||
"<|im_start|>user\n{}<|im_end|>\n<|im_start|>assistant\n")
|
||||
tokens = clip.tokenize(image_prompt + prompt, images=images_vl, llama_template=template)
|
||||
conditioning = clip.encode_from_tokens_scheduled(tokens)
|
||||
try:
|
||||
conditioning = clip.encode_from_tokens_scheduled(tokens)
|
||||
except NotImplementedError as exc:
|
||||
# ComfyUI's Qwen3-VL vision tower (qwen35.py fast_pos_embed_interpolate) adds the
|
||||
# pos-embed weights without casting, so an FP8-loaded text encoder crashes on the
|
||||
# image path. Turn the cryptic torch error into an actionable one.
|
||||
if images_vl and "Float8" in str(exc):
|
||||
raise RuntimeError(
|
||||
"Text Encode (Krea2): the Qwen3-VL text encoder is loaded in FP8, which "
|
||||
"ComfyUI's vision tower cannot run on the image path ('add_stub not "
|
||||
"implemented for Float8_e4m3fn' in the pos-embed). Load a bf16/fp16 "
|
||||
"Qwen3-VL-4B text encoder (e.g. a qwen3vl_4b *bf16* file) via CLIPLoader "
|
||||
"type 'krea2' when using image references. The FP8 encoder works only for "
|
||||
"text-only prompts."
|
||||
) from exc
|
||||
raise
|
||||
return (conditioning,)
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
[project]
|
||||
name = "comfyui-krea2-text-encoder"
|
||||
description = "Vision-aware text conditioning for the Krea2 / K2 model. Feeds reference images through the Qwen3-VL-4B vision path with the Krea2 descriptor template; optional per-image mask crops to the masked region. No VAE (Krea2 has no reference-latent pathway). Auto-growing image+mask slots."
|
||||
version = "1.0.2"
|
||||
version = "1.0.3"
|
||||
license = "MIT"
|
||||
requires-python = ">=3.10"
|
||||
dependencies = []
|
||||
|
||||
Reference in New Issue
Block a user