mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 01:04:32 +02:00
Pass device to Compel
This commit is contained in:
@@ -3,6 +3,7 @@ import typing
|
||||
import torch
|
||||
import diffusers
|
||||
from compel import Compel, ReturnedEmbeddingsType
|
||||
import modules.devices as devices
|
||||
import modules.shared as shared
|
||||
import modules.prompt_parser as prompt_parser
|
||||
|
||||
@@ -93,6 +94,7 @@ def compel_encode_prompt(
|
||||
text_encoder=pipeline.text_encoder,
|
||||
returned_embeddings_type=embedding_type,
|
||||
requires_pooled=False,
|
||||
device=devices.device
|
||||
)
|
||||
|
||||
if shared.sd_model_type == "sdxl":
|
||||
@@ -101,6 +103,7 @@ def compel_encode_prompt(
|
||||
text_encoder=pipeline.text_encoder_2,
|
||||
returned_embeddings_type=embedding_type,
|
||||
requires_pooled=True,
|
||||
device=devices.device
|
||||
)
|
||||
if not is_refiner:
|
||||
positive_te1 = compel_te1(prompt)
|
||||
|
||||
Reference in New Issue
Block a user