|
1 | 1 | import os |
2 | 2 | from folder_paths import get_folder_paths |
| 3 | +import logging |
3 | 4 | import torch |
4 | 5 | import random |
5 | | -from comfy.utils import common_upscale |
6 | 6 | from nodes import MAX_RESOLUTION |
7 | 7 | import base64 |
8 | 8 | from io import BytesIO |
9 | 9 | from PIL import Image |
10 | 10 | import numpy as np |
11 | | -from comfy.utils import common_upscale |
12 | | -from nodes import MAX_RESOLUTION, LoraLoader |
13 | 11 | import re |
14 | | -import os |
15 | 12 | from transformers import AutoModelForCausalLM, AutoTokenizer |
16 | | -import logging |
17 | 13 |
|
18 | 14 | # Base64ToImageNode |
19 | 15 | class Base64ToImageNode: |
20 | | - @classmethod |
| 16 | + @classmethod |
21 | 17 | def INPUT_TYPES(cls): |
22 | 18 | return { |
23 | 19 | "required": { |
@@ -50,7 +46,7 @@ def convert_base64(self, base64_str): |
50 | 46 |
|
51 | 47 | # FloatInputNode |
52 | 48 | class FloatInputNode: |
53 | | - @classmethod |
| 49 | + @classmethod |
54 | 50 | def INPUT_TYPES(cls): |
55 | 51 | return { |
56 | 52 | "required": { |
@@ -192,7 +188,7 @@ def get_size(self, image): |
192 | 188 |
|
193 | 189 | # IntInputNode |
194 | 190 | class IntInputNode: |
195 | | - @classmethod |
| 191 | + @classmethod |
196 | 192 | def INPUT_TYPES(cls): |
197 | 193 | return { |
198 | 194 | "required": { |
@@ -275,7 +271,7 @@ def translate(self, text): |
275 | 271 |
|
276 | 272 | # TextInputNode |
277 | 273 | class TextInputNode: |
278 | | - @classmethod |
| 274 | + @classmethod |
279 | 275 | def INPUT_TYPES(cls): |
280 | 276 | return { |
281 | 277 | "required": { |
@@ -322,7 +318,7 @@ def INPUT_TYPES(cls): |
322 | 318 | def generate_seed(self, seed, control_after_generate): |
323 | 319 | # 先保存当前显示的种子值用于返回 |
324 | 320 | seed_to_return = seed |
325 | | - |
| 321 | + |
326 | 322 | # 如果需要随机化,则在返回当前种子后,为下一次准备一个新的随机种子 |
327 | 323 | if control_after_generate: |
328 | 324 | # 生成新的随机种子并存储,但不立即返回 |
@@ -360,21 +356,21 @@ def divide_by_four(self, input_float): |
360 | 356 | "Base64ToImageNode by IAT": Base64ToImageNode, |
361 | 357 | "FloatInputNode by IAT": FloatInputNode, |
362 | 358 | "ImageMatchSize by IAT": ImageMatchSize, |
363 | | - "ImageResizeLongestSide by IAT": ImageResizeLongestSideNode, |
| 359 | + "ImageResizeLongestSide by IAT": ImageResizeLongestSideNode, |
364 | 360 | "ImageResizeToSDXL by IAT": ImageResizeToSDXL, |
365 | | - "ImageSize by IAT": ImageSizeNode, |
| 361 | + "ImageSize by IAT": ImageSizeNode, |
366 | 362 | "IntInputNode by IAT": IntInputNode, |
367 | 363 | "QwenTranslator by IAT": QwenTranslator, |
368 | 364 | "TextInputNode by IAT": TextInputNode, |
369 | 365 | "SeedGeneratorNode by IAT": SeedGeneratorNode, |
370 | | - "FloatDivideByFourNode by IAT": FloatDivideByFourNode, |
| 366 | + "FloatDivideByFourNode by IAT": FloatDivideByFourNode, |
371 | 367 | } |
372 | 368 |
|
373 | 369 | NODE_DISPLAY_NAME_MAPPINGS = { |
374 | 370 | "Base64ToImageNode by IAT": "Base64 to Image by IAT", |
375 | 371 | "FloatInputNode by IAT": "Float Input by IAT", |
376 | 372 | "ImageMatchSize by IAT": "Image Match Size by IAT", |
377 | | - "ImageResizeLongestSide by IAT": "Image Resize Longest Side by IAT", |
| 373 | + "ImageResizeLongestSide by IAT": "Image Resize Longest Side by IAT", |
378 | 374 | "ImageResizeToSDXL by IAT": "ImageResizeToSDXL by IAT", |
379 | 375 | "ImageSize by IAT": "Image Size by IAT", |
380 | 376 | "IntInputNode by IAT": "Integer Input by IAT", |
|
0 commit comments