Cleaner way of enabling quantized mm on text gen but not on text enc.… · code/app-python-comfyui@249c5a3 · GitHub
Skip to content

Commit 249c5a3

Browse files
Cleaner way of enabling quantized mm on text gen but not on text enc. (Comfy-Org#16189)
1 parent b7ebfd7 commit 249c5a3

3 files changed

Lines changed: 49 additions & 23 deletions

File tree

‎comfy/ops.py‎

Lines changed: 46 additions & 21 deletions

‎comfy/sd.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ def generate(self, tokens, do_sample=True, max_length=256, temperature=1.0, top_
475475
self.cond_stage_model.set_clip_options({"layer": None})
476476
self.cond_stage_model.set_clip_options({"execution_device": device})
477477

478-
with model_management.cuda_device_context(device):
478+
with model_management.cuda_device_context(device), comfy.ops.use_quantized_matmul(self.cond_stage_model, device):
479479
return self.cond_stage_model.generate(tokens, do_sample=do_sample, max_length=max_length, temperature=temperature, top_k=top_k, top_p=top_p, min_p=min_p, repetition_penalty=repetition_penalty, seed=seed, presence_penalty=presence_penalty)
480480

481481
def decode(self, token_ids, skip_special_tokens=True):

‎comfy/text_encoders/ace15.py‎

Lines changed: 2 additions & 1 deletion

0 commit comments

Comments
 (0)