Skip to content

Commit 9ca581c

Browse files
Remove windows line endings. (Comfy-Org#8902)
1 parent 4831e9c commit 9ca581c

1 file changed

Lines changed: 24 additions & 24 deletions

File tree

comfy_extras/nodes_pixart.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
from nodes import MAX_RESOLUTION
2-
3-
class CLIPTextEncodePixArtAlpha:
4-
@classmethod
5-
def INPUT_TYPES(s):
6-
return {"required": {
7-
"width": ("INT", {"default": 1024.0, "min": 0, "max": MAX_RESOLUTION}),
8-
"height": ("INT", {"default": 1024.0, "min": 0, "max": MAX_RESOLUTION}),
9-
# "aspect_ratio": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 10.0, "step": 0.01}),
10-
"text": ("STRING", {"multiline": True, "dynamicPrompts": True}), "clip": ("CLIP", ),
11-
}}
12-
13-
RETURN_TYPES = ("CONDITIONING",)
14-
FUNCTION = "encode"
15-
CATEGORY = "advanced/conditioning"
16-
DESCRIPTION = "Encodes text and sets the resolution conditioning for PixArt Alpha. Does not apply to PixArt Sigma."
17-
18-
def encode(self, clip, width, height, text):
19-
tokens = clip.tokenize(text)
20-
return (clip.encode_from_tokens_scheduled(tokens, add_dict={"width": width, "height": height}),)
21-
22-
NODE_CLASS_MAPPINGS = {
23-
"CLIPTextEncodePixArtAlpha": CLIPTextEncodePixArtAlpha,
24-
}
1+
from nodes import MAX_RESOLUTION
2+
3+
class CLIPTextEncodePixArtAlpha:
4+
@classmethod
5+
def INPUT_TYPES(s):
6+
return {"required": {
7+
"width": ("INT", {"default": 1024.0, "min": 0, "max": MAX_RESOLUTION}),
8+
"height": ("INT", {"default": 1024.0, "min": 0, "max": MAX_RESOLUTION}),
9+
# "aspect_ratio": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 10.0, "step": 0.01}),
10+
"text": ("STRING", {"multiline": True, "dynamicPrompts": True}), "clip": ("CLIP", ),
11+
}}
12+
13+
RETURN_TYPES = ("CONDITIONING",)
14+
FUNCTION = "encode"
15+
CATEGORY = "advanced/conditioning"
16+
DESCRIPTION = "Encodes text and sets the resolution conditioning for PixArt Alpha. Does not apply to PixArt Sigma."
17+
18+
def encode(self, clip, width, height, text):
19+
tokens = clip.tokenize(text)
20+
return (clip.encode_from_tokens_scheduled(tokens, add_dict={"width": width, "height": height}),)
21+
22+
NODE_CLASS_MAPPINGS = {
23+
"CLIPTextEncodePixArtAlpha": CLIPTextEncodePixArtAlpha,
24+
}

0 commit comments

Comments
 (0)