mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-09-13 07:57:04 +08:00
PixArtAlpha text encode with conds
This commit is contained in:
parent
41b7be08dc
commit
703b79b99d
24
comfy_extras/nodes_pixart.py
Normal file
24
comfy_extras/nodes_pixart.py
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
from nodes import MAX_RESOLUTION
|
||||||
|
|
||||||
|
class CLIPTextEncodePixArtAlpha:
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(s):
|
||||||
|
return {"required": {
|
||||||
|
"width": ("INT", {"default": 1024.0, "min": 0, "max": MAX_RESOLUTION}),
|
||||||
|
"height": ("INT", {"default": 1024.0, "min": 0, "max": MAX_RESOLUTION}),
|
||||||
|
# "aspect_ratio": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 10.0, "step": 0.01}),
|
||||||
|
"text": ("STRING", {"multiline": True, "dynamicPrompts": True}), "clip": ("CLIP", ),
|
||||||
|
}}
|
||||||
|
|
||||||
|
RETURN_TYPES = ("CONDITIONING",)
|
||||||
|
FUNCTION = "encode"
|
||||||
|
CATEGORY = "advanced/conditioning"
|
||||||
|
DESCRIPTION = "Encodes text and sets the resolution conditioning for PixArt Alpha. Does not apply to PixArt Sigma."
|
||||||
|
|
||||||
|
def encode(self, clip, width, height, text):
|
||||||
|
tokens = clip.tokenize(text)
|
||||||
|
return (clip.encode_from_tokens_scheduled(tokens, add_dict={"width": width, "height": height}),)
|
||||||
|
|
||||||
|
NODE_CLASS_MAPPINGS = {
|
||||||
|
"CLIPTextEncodePixArtAlpha": CLIPTextEncodePixArtAlpha,
|
||||||
|
}
|
||||||
1
nodes.py
1
nodes.py
@ -2128,6 +2128,7 @@ def init_builtin_extra_nodes():
|
|||||||
"nodes_stable3d.py",
|
"nodes_stable3d.py",
|
||||||
"nodes_sdupscale.py",
|
"nodes_sdupscale.py",
|
||||||
"nodes_photomaker.py",
|
"nodes_photomaker.py",
|
||||||
|
"nodes_pixart.py",
|
||||||
"nodes_cond.py",
|
"nodes_cond.py",
|
||||||
"nodes_morphology.py",
|
"nodes_morphology.py",
|
||||||
"nodes_stable_cascade.py",
|
"nodes_stable_cascade.py",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user