File size: 6,076 Bytes
613c9ab
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# Made by Davemane42#0042 for ComfyUI
import os
import subprocess
import importlib.util
import sys
import filecmp
import shutil

import __main__

python = sys.executable


extentions_folder = os.path.join(os.path.dirname(os.path.realpath(__main__.__file__)),
                                 "web" + os.sep + "extensions" + os.sep + "FizzleDorf")
javascript_folder = os.path.join(os.path.dirname(os.path.realpath(__file__)), "javascript")

if not os.path.exists(extentions_folder):
    print('Making the "web\extensions\FizzleDorf" folder')
    os.makedirs(extentions_folder)

result = filecmp.dircmp(javascript_folder, extentions_folder)

if result.left_only or result.diff_files:
    print('Update to javascripts files detected')
    file_list = list(result.left_only)
    file_list.extend(x for x in result.diff_files if x not in file_list)

    for file in file_list:
        print(f'Copying {file} to extensions folder')
        src_file = os.path.join(javascript_folder, file)
        dst_file = os.path.join(extentions_folder, file)
        if os.path.exists(dst_file):
            os.remove(dst_file)
        #print("disabled")
        shutil.copy(src_file, dst_file)


def is_installed(package, package_overwrite=None):
    try:
        spec = importlib.util.find_spec(package)
    except ModuleNotFoundError:
        pass

    package = package_overwrite or package

    if spec is None:
        print(f"Installing {package}...")
        command = f'"{python}" -m pip install {package}'
  
        result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True, env=os.environ)

        if result.returncode != 0:
            print(f"Couldn't install\nCommand: {command}\nError code: {result.returncode}")

from .WaveNodes import Lerp, SinWave, InvSinWave, CosWave, InvCosWave, SquareWave, SawtoothWave, TriangleWave, AbsCosWave, AbsSinWave
from .ScheduledNodes import (
    ValueSchedule, PromptSchedule, PromptScheduleNodeFlow, PromptScheduleNodeFlowEnd, PromptScheduleEncodeSDXL,
    StringSchedule, BatchPromptSchedule, BatchValueSchedule, BatchPromptScheduleEncodeSDXL, BatchStringSchedule,
    BatchValueScheduleLatentInput, BatchPromptScheduleEncodeSDXLLatentInput, BatchPromptScheduleLatentInput,
    ImageBatchFromValueSchedule
    #, BatchPromptScheduleNodeFlowEnd #, BatchGLIGENSchedule
)
from .FrameNodes import FrameConcatenate, InitNodeFrame, NodeFrame, StringConcatenate
from .HelperNodes import ConcatStringSingle, convertKeyframeKeysToBatchKeys, CalculateFrameOffset

NODE_CLASS_MAPPINGS = {
    "Lerp": Lerp,
    "SinWave": SinWave,
    "InvSinWave": InvSinWave,
    "CosWave": CosWave,
    "InvCosWave": InvCosWave,
    "SquareWave":SquareWave,
    "SawtoothWave": SawtoothWave,
    "TriangleWave": TriangleWave,
    "AbsCosWave": AbsCosWave,
    "AbsSinWave": AbsSinWave,
    "PromptSchedule": PromptSchedule,
    "ValueSchedule": ValueSchedule,
    "PromptScheduleNodeFlow": PromptScheduleNodeFlow,
    "PromptScheduleNodeFlowEnd": PromptScheduleNodeFlowEnd,
    "PromptScheduleEncodeSDXL":PromptScheduleEncodeSDXL,
    "StringSchedule":StringSchedule,
    "BatchPromptSchedule": BatchPromptSchedule,
    "BatchValueSchedule": BatchValueSchedule,
    "BatchPromptScheduleEncodeSDXL": BatchPromptScheduleEncodeSDXL,
    "BatchStringSchedule": BatchStringSchedule,
    "BatchValueScheduleLatentInput": BatchValueScheduleLatentInput,
    "BatchPromptScheduleSDXLLatentInput":BatchPromptScheduleEncodeSDXLLatentInput,
    "BatchPromptScheduleLatentInput":BatchPromptScheduleLatentInput,
    "ImageBatchFromValueSchedule":ImageBatchFromValueSchedule,
    #"BatchPromptScheduleNodeFlowEnd":BatchPromptScheduleNodeFlowEnd,
    #"BatchGLIGENSchedule": BatchGLIGENSchedule,

    "StringConcatenate":StringConcatenate,
    "Init FizzFrame":InitNodeFrame,
    "FizzFrame":NodeFrame,
    "FizzFrameConcatenate":FrameConcatenate,

    "ConcatStringSingle": ConcatStringSingle,
    "convertKeyframeKeysToBatchKeys": convertKeyframeKeysToBatchKeys,
    "CalculateFrameOffset":CalculateFrameOffset,
}

NODE_DISPLAY_NAME_MAPPINGS = {
    "Lerp": "Lerp πŸ“…πŸ…•πŸ…",
    "SinWave": "SinWave πŸ“…πŸ…•πŸ…",
    "InvSinWave": "InvSinWave πŸ“…πŸ…•πŸ…",
    "CosWave": "CosWave πŸ“…πŸ…•πŸ…",
    "InvCosWave": "InvCosWave πŸ“…πŸ…•πŸ…",
    "SquareWave":"SquareWave πŸ“…πŸ…•πŸ…",
    "SawtoothWave": "SawtoothWave πŸ“…πŸ…•πŸ…",
    "TriangleWave": "TriangleWave πŸ“…πŸ…•πŸ…",
    "AbsCosWave": "AbsCosWave πŸ“…πŸ…•πŸ…",
    "AbsSinWave": "AbsSinWave πŸ“…πŸ…•πŸ…",
    "PromptSchedule": "Prompt Schedule πŸ“…πŸ…•πŸ…",
    "ValueSchedule": "Value Schedule πŸ“…πŸ…•πŸ…",
    "PromptScheduleNodeFlow": "Prompt Schedule NodeFlow πŸ“…πŸ…•πŸ…",
    "PromptScheduleNodeFlowEnd": "Prompt Schedule NodeFlow End πŸ“…πŸ…•πŸ…",
    "StringSchedule":"String Schedule πŸ“…πŸ…•πŸ…",
    "StringConcatenate":"String Concatenate πŸ“…πŸ…•πŸ…",
    "Init FizzFrame":"Init Node Frame πŸ“…πŸ…•πŸ…",
    "FizzFrame":"Node Frame πŸ“…πŸ…•πŸ…",
    "FizzFrameConcatenate":"Frame Concatenate πŸ“…πŸ…•πŸ…",
    "BatchPromptSchedule": "Batch Prompt Schedule πŸ“…πŸ…•πŸ…",
    "BatchValueSchedule": "Batch Value Schedule πŸ“…πŸ…•πŸ…",
    "PromptScheduleEncodeSDXL": "Prompt Schedule SDXL πŸ“…πŸ…•πŸ…",
    "BatchPromptScheduleEncodeSDXL": "Batch Prompt Schedule SDXL πŸ“…πŸ…•πŸ…",
    "BatchStringSchedule": "Batch String Schedule πŸ“…πŸ…•πŸ…",
    "BatchValueScheduleLatentInput": "Batch Value Schedule (Latent Input) πŸ“…πŸ…•πŸ…",
    "BatchPromptScheduleSDXLLatentInput": "Batch Prompt Schedule SDXL (Latent Input) πŸ“…πŸ…•πŸ…",
    "BatchPromptScheduleLatentInput": "Batch Prompt Schedule (Latent Input) πŸ“…πŸ…•πŸ…",
    "ImageBatchFromValueSchedule":"Image Batch From Value Schedule πŸ“…πŸ…•πŸ…",
    "ConcatStringSingle": "Concat String (Single) πŸ“…πŸ…•πŸ…",
    "convertKeyframeKeysToBatchKeys":"Keyframe Keys To Batch Keys πŸ“…πŸ…•πŸ…",
    "SelectFrameNumber":"Select Frame Number πŸ“…πŸ…•πŸ…",
    "CalculateFrameOffset":"Calculate Frame Offset πŸ“…πŸ…•πŸ…",
}
print('\033[34mFizzleDorf Custom Nodes: \033[92mLoaded\033[0m')