feat: Make Image Batch

This commit is contained in:
Dr.Lt.Data
2023-09-26 16:48:03 +09:00
parent 6b8a4a37fc
commit 2ea8048ec9
5 changed files with 33 additions and 2 deletions
+1
View File
@@ -163,6 +163,7 @@ This takes latent as input and outputs latent as the result.
* Image batch To Image List - Convert Image batch to Image List
- You can use images generated in a multi batch to handle them
* Make Image List - Convert multiple images into a single image list
* Make Image Batch - Convert multiple images into a single image batch
- The input of images can be scaled up as needed
* String Selector - It selects and returns a portion of the string. When `multiline` mode is disabled, it simply returns the string of the line pointed to by the selector. When `multiline` mode is enabled, it divides the string based on lines that start with `#` and returns them. If the `select` value is larger than the number of items, it will start counting from the first line again and return accordingly.
+2
View File
@@ -223,6 +223,7 @@ NODE_CLASS_MAPPINGS = {
"ImpactImageBatchToImageList": ImageBatchToImageList,
"ImpactMakeImageList": MakeImageList,
"ImpactMakeImageBatch": MakeImageBatch,
"RegionalSampler": RegionalSampler,
"RegionalSamplerAdvanced": RegionalSamplerAdvanced,
@@ -327,6 +328,7 @@ NODE_DISPLAY_NAME_MAPPINGS = {
"MaskListToMaskBatch": "Mask List to Masks",
"ImpactImageBatchToImageList": "Image batch to Image List",
"ImpactMakeImageList": "Make Image List",
"ImpactMakeImageBatch": "Make Image Batch",
"ImpactStringSelector": "String Selector",
"RemoveNoiseMask": "Remove Noise Mask",
+4 -1
View File
@@ -285,11 +285,14 @@ app.registerExtension({
}
}
if (nodeData.name === 'ImpactMakeImageList' || nodeData.name === 'CombineRegionalPrompts' || nodeData.name === 'ImpactSwitch' || nodeData.name === 'LatentSwitch' || nodeData.name == 'SEGSSwitch') {
if (nodeData.name === 'ImpactMakeImageList' || nodeData.name === 'ImpactMakeImageBatch' ||
nodeData.name === 'CombineRegionalPrompts' || nodeData.name === 'ImpactSwitch' ||
nodeData.name === 'LatentSwitch' || nodeData.name == 'SEGSSwitch') {
var input_name = "input";
switch(nodeData.name) {
case 'ImpactMakeImageList':
case 'ImpactMakeImageBatch':
input_name = "image";
break;
+1 -1
View File
@@ -2,7 +2,7 @@ import configparser
import os
version = "V4.9.6"
version = "V4.10"
dependency_version = 12
+25
View File
@@ -1982,6 +1982,31 @@ class MakeImageList:
return (images, )
class MakeImageBatch:
@classmethod
def INPUT_TYPES(s):
return {"required": {"image1": ("IMAGE",), }}
RETURN_TYPES = ("IMAGE",)
FUNCTION = "doit"
CATEGORY = "ImpactPack/Util"
def doit(self, **kwargs):
image1 = kwargs['image1']
del kwargs['image1']
images = [value for value in kwargs.values()]
if len(images) == 0:
return (image1,)
else:
for image2 in images:
if image1.shape[1:] != image2.shape[1:]:
image2 = comfy.utils.common_upscale(image2.movedim(-1, 1), image1.shape[2], image1.shape[1], "bilinear", "center").movedim(1, -1)
image1 = torch.cat((image1, image2), dim=0)
return (image1,)
class StringSelector:
@classmethod
def INPUT_TYPES(s):