Skip to content

Commit fb478f6

Browse files
Only apply gemma quant config to gemma model for newbie. (comfyanonymous#11436)
1 parent 4c432c1 commit fb478f6

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

comfy/text_encoders/lumina2.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ def __init__(self, device="cpu", layer="hidden", layer_idx=-2, dtype=None, atten
3333

3434
class Gemma3_4BModel(sd1_clip.SDClipModel):
3535
def __init__(self, device="cpu", layer="hidden", layer_idx=-2, dtype=None, attention_mask=True, model_options={}):
36+
llama_quantization_metadata = model_options.get("llama_quantization_metadata", None)
37+
if llama_quantization_metadata is not None:
38+
model_options = model_options.copy()
39+
model_options["quantization_metadata"] = llama_quantization_metadata
40+
3641
super().__init__(device=device, layer=layer, layer_idx=layer_idx, textmodel_json_config={}, dtype=dtype, special_tokens={"start": 2, "pad": 0}, layer_norm_hidden_state=False, model_class=comfy.text_encoders.llama.Gemma3_4B, enable_attention_masks=attention_mask, return_attention_masks=attention_mask, model_options=model_options)
3742

3843
class LuminaModel(sd1_clip.SD1ClipModel):

comfy/text_encoders/newbie.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ class NewBieTEModel_(NewBieTEModel):
5757
def __init__(self, device="cpu", dtype=None, model_options={}):
5858
if llama_quantization_metadata is not None:
5959
model_options = model_options.copy()
60-
model_options["quantization_metadata"] = llama_quantization_metadata
60+
model_options["llama_quantization_metadata"] = llama_quantization_metadata
6161
super().__init__(dtype_gemma=dtype_llama, device=device, dtype=dtype, model_options=model_options)
6262
return NewBieTEModel_

0 commit comments

Comments
 (0)