This commit is contained in:
flak (home)
2023-09-14 16:14:40 +03:00
parent 6f4ac986f3
commit 35a81a0417
2 changed files with 14 additions and 6 deletions
+10 -3
View File
@@ -1,4 +1,5 @@
import copy
import PIL
import torch
@@ -94,14 +95,21 @@ class MakeCircularVAE:
vae_copy.first_stage_model.apply(unmake_circular)
return (vae_copy,)
class OffsetImage:
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"pixels": ("IMAGE",),
"x_percent": ("FLOAT", {"default": 50.0, "min": 0.0, "max": 100.0, "step": 1}),
"y_percent": ("FLOAT", {"default": 50.0, "min": 0.0, "max": 100.0, "step": 1}),
"x_percent": (
"FLOAT",
{"default": 50.0, "min": 0.0, "max": 100.0, "step": 1},
),
"y_percent": (
"FLOAT",
{"default": 50.0, "min": 0.0, "max": 100.0, "step": 1},
),
}
}
@@ -115,4 +123,3 @@ class OffsetImage:
y = round(y * y_percent / 100)
x = round(x * x_percent / 100)
return (pixels.roll((y, x), (1, 2)),)
+4 -3
View File
@@ -1,17 +1,18 @@
from .SeamlessTile import CircularVAEDecode, MakeCircularVAE, SeamlessTile, OffsetImage
from .SeamlessTile import (CircularVAEDecode, MakeCircularVAE, OffsetImage,
SeamlessTile)
NODE_CLASS_MAPPINGS = {
"SeamlessTile": SeamlessTile,
"CircularVAEDecode": CircularVAEDecode,
"MakeCircularVAE": MakeCircularVAE,
"OffsetImage": OffsetImage
"OffsetImage": OffsetImage,
}
NODE_DISPLAY_NAME_MAPPINGS = {
"SeamlessTile": "Seamless Tile",
"CircularVAEDecode": "Circular VAE Decode (tile)",
"MakeCircularVAE": "Make Circular VAE",
"OffsetImage": "Offset Image"
"OffsetImage": "Offset Image",
}
__all__ = [NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS]