mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-05 11:10:16 +08:00
Add resize in CLIPTextEncodeKandinsky5
This commit is contained in:
parent
646cf6600a
commit
04f2e27c40
@ -160,7 +160,12 @@ class CLIPTextEncodeKandinsky5(io.ComfyNode):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def execute(cls, clip, prompt, image=None) -> io.NodeOutput:
|
def execute(cls, clip, prompt, image=None) -> io.NodeOutput:
|
||||||
images = [image,] if image is not None else []
|
images = []
|
||||||
|
if image is not None:
|
||||||
|
image = image.permute(0,3,1,2)
|
||||||
|
height, width = image.shape[-2:]
|
||||||
|
image = F.resize(image, (int(height / 2), int(width / 2))).permute(0,2,3,1)
|
||||||
|
images.append(image)
|
||||||
tokens = clip.tokenize(prompt, images=images)
|
tokens = clip.tokenize(prompt, images=images)
|
||||||
conditioning = clip.encode_from_tokens_scheduled(tokens)
|
conditioning = clip.encode_from_tokens_scheduled(tokens)
|
||||||
return io.NodeOutput(conditioning)
|
return io.NodeOutput(conditioning)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user