MCPcopy Create free account
hub / github.com/Lightricks/ComfyUI-LTXVideo / APGGuiderNode

Class APGGuiderNode

stg.py:888–944  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

886
887@comfy_node(name="APGGuider")
888class APGGuiderNode:
889 @classmethod
890 def INPUT_TYPES(s):
891 return {
892 "required": {
893 "model": ("MODEL",),
894 "positive": ("CONDITIONING",),
895 "negative": ("CONDITIONING",),
896 "cfg_scale": (
897 "FLOAT",
898 {"default": 1.0, "min": 0.0, "max": 100.0, "step": 0.01},
899 ),
900 "eta": (
901 "FLOAT",
902 {"default": 1.0, "min": 0.0, "max": 100.0, "step": 0.01},
903 ),
904 "norm_threshold": (
905 "FLOAT",
906 {"default": 0.0, "min": 0.0, "max": 100.0, "step": 0.01},
907 ),
908 "momentum_coefficient": (
909 "FLOAT",
910 {"default": -0.9, "min": -3.0, "max": 3.0, "step": 0.01},
911 ),
912 },
913 }
914
915 RETURN_TYPES = ("GUIDER",)
916
917 FUNCTION = "get_guider"
918 CATEGORY = "lightricks/LTXV"
919
920 DESCRIPTION = """
921 The APG Guider implements Adaptive Projected Guidance (APG).
922 Reference: https://arxiv.org/abs/2410.02416.
923 """
924
925 def get_guider(
926 self,
927 model,
928 positive,
929 negative,
930 cfg_scale,
931 eta,
932 norm_threshold,
933 momentum_coefficient,
934 ):
935 guider = APGGuider(
936 model,
937 cfg_scale,
938 eta,
939 norm_threshold,
940 momentum_coefficient,
941 )
942 guider.set_conds(positive, negative)
943 guider.raw_conds = (positive, negative)
944 return (guider,)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected