Update Schedulers List
This commit is contained in:
+61
-62
@@ -1,5 +1,6 @@
|
||||
from .utils import runwareUtils as rwUtils
|
||||
|
||||
|
||||
class txt2img:
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
@@ -9,10 +10,10 @@ class txt2img:
|
||||
"tooltip": "Connect a Runware Model From Runware Model Node.",
|
||||
}),
|
||||
"positivePrompt": ("STRING", {
|
||||
"multiline": True,
|
||||
"placeholder": "Positive Prompt: a text instruction to guide the model on generating the image. It is usually a sentence or a paragraph that provides positive guidance for the task. This parameter is essential to shape the desired results.\n\nYou Can Press (Ctrl + Alt + E) To Enhance The Prompt!",
|
||||
"tooltip": "Positive Prompt: a text instruction to guide the model on generating the image. You Can Also Press (Ctrl + Alt + E) To Enhance The Prompt!"
|
||||
}),
|
||||
"multiline": True,
|
||||
"placeholder": "Positive Prompt: a text instruction to guide the model on generating the image. It is usually a sentence or a paragraph that provides positive guidance for the task. This parameter is essential to shape the desired results.\n\nYou Can Press (Ctrl + Alt + E) To Enhance The Prompt!",
|
||||
"tooltip": "Positive Prompt: a text instruction to guide the model on generating the image. You Can Also Press (Ctrl + Alt + E) To Enhance The Prompt!"
|
||||
}),
|
||||
"negativePrompt": ("STRING", {
|
||||
"multiline": True,
|
||||
"placeholder": "Negative Prompt: a text instruction to guide the model on generating the image. It is usually a sentence or a paragraph that provides negative guidance for the task. This parameter helps to avoid certain undesired results.",
|
||||
@@ -31,46 +32,43 @@ class txt2img:
|
||||
"tooltip": "Adjust the dimensions of the generated image by specifying its width and height in pixels, or select from the predefined options. Image dimensions must be multiples of 64 (e.g., 512x512, 1024x768).",
|
||||
}),
|
||||
"width": ("INT", {
|
||||
"tooltip": "The Width of the image in pixels.",
|
||||
"default": 512,
|
||||
"min": 512,
|
||||
"max": 2048,
|
||||
"step": 64,
|
||||
"tooltip": "The Width of the image in pixels.",
|
||||
"default": 512,
|
||||
"min": 512,
|
||||
"max": 2048,
|
||||
"step": 64,
|
||||
}),
|
||||
"height": ("INT", {
|
||||
"tooltip": "The Height of the image in pixels.",
|
||||
"default": 512,
|
||||
"min": 512,
|
||||
"max": 2048,
|
||||
"step": 64,
|
||||
}),
|
||||
"tooltip": "The Height of the image in pixels.",
|
||||
"default": 512,
|
||||
"min": 512,
|
||||
"max": 2048,
|
||||
"step": 64,
|
||||
}),
|
||||
"steps": ("INT", {
|
||||
"tooltip": "The number of steps is the number of iterations the model will perform to generate the image. The higher the number of steps, the more detailed the image will be. However, increasing the number of steps will also increase the time it takes to generate the image and may not always result in a better image.",
|
||||
"default": 4,
|
||||
"min": 1,
|
||||
"max": 100,
|
||||
}),
|
||||
"scheduler": ([
|
||||
"Default", "DDIMScheduler", "DDIMInverseScheduler", "DDPMScheduler", "DEISMultistepScheduler",
|
||||
"DPMSolverSinglestepScheduler", "DPMSolverMultistepScheduler", "DPMSolverMultistepInverse", "DPMSolverSDEScheduler", "HeunDiscreteScheduler", "KDPM2DiscreteScheduler", "KDPM2AncestralDiscreteScheduler", "KarrasVeScheduler", "LMSDiscreteScheduler", "PNDMScheduler", "ScoreSdeVeScheduler", "ScoreSdeVpScheduler", "IPNDMScheduler", "EulerDiscreteScheduler", "EulerAncestralDiscreteScheduler", "EDMEulerScheduler", "FlowMatchEulerDiscreteScheduler", "VQDiffusionScheduler", "UniPCMultistepScheduler", "RePaintScheduler", "DPM++ 2M Karras", "DPM++ 2M SDE Karras", "DPM++ 2M SDE", "DPM++ SDE Karras", "DPM++ SDE", "LCMScheduler", "EDMDPMSolverMultistepScheduler", "TCDScheduler"
|
||||
], {
|
||||
"tooltip": "An scheduler is a component that manages the inference process. Different schedulers can be used to achieve different results like more detailed images, faster inference, or more accurate results.",
|
||||
"default": "Default",
|
||||
}),
|
||||
"tooltip": "The number of steps is the number of iterations the model will perform to generate the image. The higher the number of steps, the more detailed the image will be. However, increasing the number of steps will also increase the time it takes to generate the image and may not always result in a better image.",
|
||||
"default": 4,
|
||||
"min": 1,
|
||||
"max": 100,
|
||||
}),
|
||||
"scheduler": (['Default', 'DDIM', 'DDIMScheduler', 'DDPMScheduler', 'DEISMultistepScheduler', 'DPMSolverSinglestepScheduler', 'DPMSolverMultistepScheduler', 'DPMSolverMultistepInverse', 'DPM++', 'DPM++ Karras', 'DPM++ 2M', 'DPM++ 2M Karras', 'DPM++ 2M SDE Karras', 'DPM++ 2M SDE', 'DPM++ 3M', 'DPM++ 3M Karras', 'DPM++ SDE Karras', 'DPM++ SDE', 'EDMEulerScheduler', 'EDMDPMSolverMultistepScheduler', 'Euler', 'EulerDiscreteScheduler', 'Euler Karras', 'Euler a', 'EulerAncestralDiscreteScheduler', 'FlowMatchEulerDiscreteScheduler', 'Heun', 'HeunDiscreteScheduler', 'Heun Karras', 'IPNDMScheduler', 'KDPM2DiscreteScheduler', 'KDPM2AncestralDiscreteScheduler', 'LCM', 'LCMScheduler', 'LMS', 'LMSDiscreteScheduler', 'LMS Karras', 'PNDMScheduler', 'TCDScheduler', 'UniPC', 'UniPCMultistepScheduler', 'UniPC Karras', 'UniPC 2M', 'UniPC 2M Karras', 'UniPC 3M', 'UniPC 3M Karras'], {
|
||||
"tooltip": "An scheduler is a component that manages the inference process. Different schedulers can be used to achieve different results like more detailed images, faster inference, or more accurate results.",
|
||||
"default": "Default",
|
||||
}),
|
||||
"cfgScale": ("FLOAT", {
|
||||
"tooltip": "Guidance scale represents how closely the images will resemble the prompt or how much freedom the AI model has. Higher values are closer to the prompt. Low values may reduce the quality of the results.",
|
||||
"default": 6.5,
|
||||
"min": 1.0,
|
||||
"max": 30.0,
|
||||
"step": 0.5,
|
||||
}),
|
||||
"tooltip": "Guidance scale represents how closely the images will resemble the prompt or how much freedom the AI model has. Higher values are closer to the prompt. Low values may reduce the quality of the results.",
|
||||
"default": 6.5,
|
||||
"min": 1.0,
|
||||
"max": 30.0,
|
||||
"step": 0.5,
|
||||
}),
|
||||
"seed": ("INT", {
|
||||
"tooltip": "A value used to randomize the image generation. If you want to make images reproducible (generate the same image multiple times), you can use the same seed value.",
|
||||
"default": rwUtils.genRandSeed(),
|
||||
"min": 1,
|
||||
"max": 9223372036854776000,
|
||||
}),
|
||||
"clipSkip": ("INT", {
|
||||
"tooltip": "A value used to randomize the image generation. If you want to make images reproducible (generate the same image multiple times), you can use the same seed value.",
|
||||
"default": rwUtils.genRandSeed(),
|
||||
"min": 1,
|
||||
"max": 9223372036854776000,
|
||||
}),
|
||||
"clipSkip": ("INT", {
|
||||
"tooltip": "Enables skipping layers of the CLIP embedding process, leading to quicker and more varied image generation.",
|
||||
"default": 0,
|
||||
"min": 0,
|
||||
@@ -96,10 +94,10 @@ class txt2img:
|
||||
"max": 128,
|
||||
}),
|
||||
"batchSize": ("INT", {
|
||||
"tooltip": "The number of images to generate in a single request.",
|
||||
"default": 1,
|
||||
"min": 1,
|
||||
"max": 10,
|
||||
"tooltip": "The number of images to generate in a single request.",
|
||||
"default": 1,
|
||||
"min": 1,
|
||||
"max": 10,
|
||||
}),
|
||||
},
|
||||
"optional": {
|
||||
@@ -130,9 +128,11 @@ class txt2img:
|
||||
@classmethod
|
||||
def VALIDATE_INPUTS(cls, positivePrompt, negativePrompt):
|
||||
if (positivePrompt is not None and (positivePrompt == "" or len(positivePrompt) < 3 or len(positivePrompt) > 2000)):
|
||||
raise Exception("Positive Prompt Must Be Between 3 And 2000 characters!")
|
||||
raise Exception(
|
||||
"Positive Prompt Must Be Between 3 And 2000 characters!")
|
||||
if (negativePrompt is not None and negativePrompt != "" and (len(negativePrompt) < 3 or len(negativePrompt) > 2000)):
|
||||
raise Exception("Negative Prompt Must Be Between 3 And 2000 characters!")
|
||||
raise Exception(
|
||||
"Negative Prompt Must Be Between 3 And 2000 characters!")
|
||||
return True
|
||||
|
||||
DESCRIPTION = "Generates Images Lightning Fast With Runware Image Inference Sonic Engine."
|
||||
@@ -164,7 +164,7 @@ class txt2img:
|
||||
seed = kwargs.get("seed")
|
||||
batchSize = kwargs.get("batchSize", 1)
|
||||
|
||||
if(maskImage is not None and seedImage is None):
|
||||
if (maskImage is not None and seedImage is None):
|
||||
raise Exception("Mask Image Requires Seed Image To Be Provided!")
|
||||
|
||||
genConfig = [
|
||||
@@ -189,40 +189,39 @@ class txt2img:
|
||||
# For Debugging Purposes Only
|
||||
print(f"[Debugging] Task UUID: {genConfig[0]['taskUUID']}")
|
||||
|
||||
if(negativePrompt is not None and negativePrompt != ""):
|
||||
if (negativePrompt is not None and negativePrompt != ""):
|
||||
genConfig[0]["negativePrompt"] = negativePrompt
|
||||
if(promptWeighting != "Disabled"):
|
||||
if(promptWeighting == "sdEmbeds"):
|
||||
if (promptWeighting != "Disabled"):
|
||||
if (promptWeighting == "sdEmbeds"):
|
||||
genConfig[0]["promptWeighting"] = "sdEmbeds"
|
||||
else:
|
||||
genConfig[0]["promptWeighting"] = "compel"
|
||||
if(runwareLora is not None):
|
||||
if(isinstance(runwareLora, list)):
|
||||
if (runwareLora is not None):
|
||||
if (isinstance(runwareLora, list)):
|
||||
genConfig[0]["lora"] = runwareLora
|
||||
elif(isinstance(runwareLora, dict)):
|
||||
elif (isinstance(runwareLora, dict)):
|
||||
genConfig[0]["lora"] = [runwareLora]
|
||||
if(runwareEmbedding is not None):
|
||||
if(isinstance(runwareEmbedding, list)):
|
||||
if (runwareEmbedding is not None):
|
||||
if (isinstance(runwareEmbedding, list)):
|
||||
genConfig[0]["embeddings"] = runwareEmbedding
|
||||
elif(isinstance(runwareEmbedding, dict)):
|
||||
elif (isinstance(runwareEmbedding, dict)):
|
||||
genConfig[0]["embeddings"] = [runwareEmbedding]
|
||||
if(runwareVAE is not None):
|
||||
if (runwareVAE is not None):
|
||||
genConfig[0]["vae"] = runwareVAE
|
||||
if(runwareControlNet is not None):
|
||||
if (runwareControlNet is not None):
|
||||
genConfig[0]["controlNet"] = runwareControlNet
|
||||
if(runwareRefiner is not None):
|
||||
if (runwareRefiner is not None):
|
||||
genConfig[0]["refiner"] = runwareRefiner
|
||||
if(seedImage is not None):
|
||||
if (seedImage is not None):
|
||||
seedImage = rwUtils.convertTensor2IMG(seedImage)
|
||||
genConfig[0]["seedImage"] = seedImage
|
||||
genConfig[0]["strength"] = seedImageStrength
|
||||
if(maskImage is not None):
|
||||
if (maskImage is not None):
|
||||
maskImage = rwUtils.convertTensor2IMG(maskImage)
|
||||
genConfig[0]["maskImage"] = maskImage
|
||||
if(enableMaskMargin):
|
||||
if (enableMaskMargin):
|
||||
genConfig[0]["maskMargin"] = maskImageMargin
|
||||
|
||||
genResult = rwUtils.inferenecRequest(genConfig)
|
||||
images = rwUtils.convertImageB64List(genResult)
|
||||
return images
|
||||
|
||||
+60
-60
@@ -1,5 +1,6 @@
|
||||
from .utils import runwareUtils as rwUtils
|
||||
|
||||
|
||||
class photoMaker:
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
@@ -9,13 +10,13 @@ class photoMaker:
|
||||
"tooltip": "Connect a Runware Model From Runware Model Node.",
|
||||
}),
|
||||
"Image 1": ("IMAGE", {
|
||||
"tooltip": "Specifies Input Image 1 that will be used as reference for the subject. These reference images help the AI to maintain identity consistency during the generation process."
|
||||
"tooltip": "Specifies Input Image 1 that will be used as reference for the subject. These reference images help the AI to maintain identity consistency during the generation process."
|
||||
}),
|
||||
"positivePrompt": ("STRING", {
|
||||
"multiline": True,
|
||||
"placeholder": "Positive Prompt: a text instruction to guide the model on generating the image. It is usually a sentence or a paragraph that provides positive guidance for the task. This parameter is essential to shape the desired results.\n\nThe PhotoMaker positive prompt must follow a specific format: the class word (like \"man\", \"woman\", \"girl\") must be followed by the trigger word \"img\".\nExample: man img, wearing a suit",
|
||||
"tooltip": "Positive Prompt: a text instruction to guide the model on generating the image.\nDo not Forget To Add trigger word \"img\" after the class word (like \"man\", \"woman\", \"girl\")",
|
||||
}),
|
||||
"multiline": True,
|
||||
"placeholder": "Positive Prompt: a text instruction to guide the model on generating the image. It is usually a sentence or a paragraph that provides positive guidance for the task. This parameter is essential to shape the desired results.\n\nThe PhotoMaker positive prompt must follow a specific format: the class word (like \"man\", \"woman\", \"girl\") must be followed by the trigger word \"img\".\nExample: man img, wearing a suit",
|
||||
"tooltip": "Positive Prompt: a text instruction to guide the model on generating the image.\nDo not Forget To Add trigger word \"img\" after the class word (like \"man\", \"woman\", \"girl\")",
|
||||
}),
|
||||
"negativePrompt": ("STRING", {
|
||||
"multiline": True,
|
||||
"placeholder": "Negative Prompt: a text instruction to guide the model on generating the image. It is usually a sentence or a paragraph that provides negative guidance for the task. This parameter helps to avoid certain undesired results.",
|
||||
@@ -26,11 +27,11 @@ class photoMaker:
|
||||
"tooltip": "Prompt weighting allows you to adjust how strongly different parts of your prompt influence the generated image.",
|
||||
}),
|
||||
"style": ([
|
||||
"No style", "Cinematic", "Disney Character", "Digital Art", "Photographic", "Fantasy art",
|
||||
"Neonpunk", "Enhance", "Comic book", "Lowpoly", "Line art"
|
||||
], {
|
||||
"default": "No style",
|
||||
"tooltip": "Specifies the artistic style to be applied to the generated images."
|
||||
"No style", "Cinematic", "Disney Character", "Digital Art", "Photographic", "Fantasy art",
|
||||
"Neonpunk", "Enhance", "Comic book", "Lowpoly", "Line art"
|
||||
], {
|
||||
"default": "No style",
|
||||
"tooltip": "Specifies the artistic style to be applied to the generated images."
|
||||
}),
|
||||
"dimensions": ([
|
||||
"Square (512x512)", "Square HD (1024x1024)", "Portrait 3:4 (768x1024)",
|
||||
@@ -41,39 +42,36 @@ class photoMaker:
|
||||
"tooltip": "Adjust the dimensions of the generated image by specifying its width and height in pixels, or select from the predefined options. Image dimensions must be multiples of 64 (e.g., 512x512, 1024x768).",
|
||||
}),
|
||||
"width": ("INT", {
|
||||
"tooltip": "The Width of the image in pixels.",
|
||||
"default": 1024,
|
||||
"min": 512,
|
||||
"max": 2048,
|
||||
"step": 64,
|
||||
"tooltip": "The Width of the image in pixels.",
|
||||
"default": 1024,
|
||||
"min": 512,
|
||||
"max": 2048,
|
||||
"step": 64,
|
||||
}),
|
||||
"height": ("INT", {
|
||||
"tooltip": "The Height of the image in pixels.",
|
||||
"default": 1024,
|
||||
"min": 512,
|
||||
"max": 2048,
|
||||
"step": 64,
|
||||
}),
|
||||
"tooltip": "The Height of the image in pixels.",
|
||||
"default": 1024,
|
||||
"min": 512,
|
||||
"max": 2048,
|
||||
"step": 64,
|
||||
}),
|
||||
"steps": ("INT", {
|
||||
"tooltip": "The number of steps is the number of iterations the model will perform to generate the image. The higher the number of steps, the more detailed the image will be. However, increasing the number of steps will also increase the time it takes to generate the image and may not always result in a better image.",
|
||||
"default": 25,
|
||||
"min": 1,
|
||||
"max": 100,
|
||||
}),
|
||||
"scheduler": ([
|
||||
"Default", "DDIMScheduler", "DDIMInverseScheduler", "DDPMScheduler", "DEISMultistepScheduler",
|
||||
"DPMSolverSinglestepScheduler", "DPMSolverMultistepScheduler", "DPMSolverMultistepInverse", "DPMSolverSDEScheduler", "HeunDiscreteScheduler", "KDPM2DiscreteScheduler", "KDPM2AncestralDiscreteScheduler", "KarrasVeScheduler", "LMSDiscreteScheduler", "PNDMScheduler", "ScoreSdeVeScheduler", "ScoreSdeVpScheduler", "IPNDMScheduler", "EulerDiscreteScheduler", "EulerAncestralDiscreteScheduler", "EDMEulerScheduler", "FlowMatchEulerDiscreteScheduler", "VQDiffusionScheduler", "UniPCMultistepScheduler", "RePaintScheduler", "DPM++ 2M Karras", "DPM++ 2M SDE Karras", "DPM++ 2M SDE", "DPM++ SDE Karras", "DPM++ SDE", "LCMScheduler", "EDMDPMSolverMultistepScheduler", "TCDScheduler"
|
||||
], {
|
||||
"tooltip": "An scheduler is a component that manages the inference process. Different schedulers can be used to achieve different results like more detailed images, faster inference, or more accurate results.",
|
||||
"default": "Default",
|
||||
}),
|
||||
"tooltip": "The number of steps is the number of iterations the model will perform to generate the image. The higher the number of steps, the more detailed the image will be. However, increasing the number of steps will also increase the time it takes to generate the image and may not always result in a better image.",
|
||||
"default": 25,
|
||||
"min": 1,
|
||||
"max": 100,
|
||||
}),
|
||||
"scheduler": (['Default', 'DDIM', 'DDIMScheduler', 'DDPMScheduler', 'DEISMultistepScheduler', 'DPMSolverSinglestepScheduler', 'DPMSolverMultistepScheduler', 'DPMSolverMultistepInverse', 'DPM++', 'DPM++ Karras', 'DPM++ 2M', 'DPM++ 2M Karras', 'DPM++ 2M SDE Karras', 'DPM++ 2M SDE', 'DPM++ 3M', 'DPM++ 3M Karras', 'DPM++ SDE Karras', 'DPM++ SDE', 'EDMEulerScheduler', 'EDMDPMSolverMultistepScheduler', 'Euler', 'EulerDiscreteScheduler', 'Euler Karras', 'Euler a', 'EulerAncestralDiscreteScheduler', 'FlowMatchEulerDiscreteScheduler', 'Heun', 'HeunDiscreteScheduler', 'Heun Karras', 'IPNDMScheduler', 'KDPM2DiscreteScheduler', 'KDPM2AncestralDiscreteScheduler', 'LCM', 'LCMScheduler', 'LMS', 'LMSDiscreteScheduler', 'LMS Karras', 'PNDMScheduler', 'TCDScheduler', 'UniPC', 'UniPCMultistepScheduler', 'UniPC Karras', 'UniPC 2M', 'UniPC 2M Karras', 'UniPC 3M', 'UniPC 3M Karras'], {
|
||||
"tooltip": "An scheduler is a component that manages the inference process. Different schedulers can be used to achieve different results like more detailed images, faster inference, or more accurate results.",
|
||||
"default": "Default",
|
||||
}),
|
||||
"cfgScale": ("FLOAT", {
|
||||
"tooltip": "Guidance scale represents how closely the images will resemble the prompt or how much freedom the AI model has. Higher values are closer to the prompt. Low values may reduce the quality of the results.",
|
||||
"default": 6.5,
|
||||
"min": 1.0,
|
||||
"max": 30.0,
|
||||
"step": 0.5,
|
||||
}),
|
||||
"tooltip": "Guidance scale represents how closely the images will resemble the prompt or how much freedom the AI model has. Higher values are closer to the prompt. Low values may reduce the quality of the results.",
|
||||
"default": 6.5,
|
||||
"min": 1.0,
|
||||
"max": 30.0,
|
||||
"step": 0.5,
|
||||
}),
|
||||
"strength": ("INT", {
|
||||
"default": 15,
|
||||
"min": 15,
|
||||
@@ -87,27 +85,27 @@ class photoMaker:
|
||||
"max": 2,
|
||||
}),
|
||||
"seed": ("INT", {
|
||||
"tooltip": "A value used to randomize the image generation. If you want to make images reproducible (generate the same image multiple times), you can use the same seed value.",
|
||||
"default": rwUtils.genRandSeed(),
|
||||
"min": 1,
|
||||
"max": 9223372036854776000,
|
||||
"tooltip": "A value used to randomize the image generation. If you want to make images reproducible (generate the same image multiple times), you can use the same seed value.",
|
||||
"default": rwUtils.genRandSeed(),
|
||||
"min": 1,
|
||||
"max": 9223372036854776000,
|
||||
}),
|
||||
"batchSize": ("INT", {
|
||||
"tooltip": "The number of images to generate in a single request.",
|
||||
"default": 1,
|
||||
"min": 1,
|
||||
"max": 10,
|
||||
"tooltip": "The number of images to generate in a single request.",
|
||||
"default": 1,
|
||||
"min": 1,
|
||||
"max": 10,
|
||||
}),
|
||||
},
|
||||
"optional": {
|
||||
"Image 2": ("IMAGE", {
|
||||
"tooltip": "Specifies Input Image 2 that will be used as reference for the subject. These reference images help the AI to maintain identity consistency during the generation process."
|
||||
"tooltip": "Specifies Input Image 2 that will be used as reference for the subject. These reference images help the AI to maintain identity consistency during the generation process."
|
||||
}),
|
||||
"Image 3": ("IMAGE", {
|
||||
"tooltip": "Specifies Input Image 3 that will be used as reference for the subject. These reference images help the AI to maintain identity consistency during the generation process."
|
||||
"tooltip": "Specifies Input Image 3 that will be used as reference for the subject. These reference images help the AI to maintain identity consistency during the generation process."
|
||||
}),
|
||||
"Image 4": ("IMAGE", {
|
||||
"tooltip": "Specifies Input Image 4 that will be used as reference for the subject. These reference images help the AI to maintain identity consistency during the generation process."
|
||||
"tooltip": "Specifies Input Image 4 that will be used as reference for the subject. These reference images help the AI to maintain identity consistency during the generation process."
|
||||
}),
|
||||
}
|
||||
}
|
||||
@@ -120,9 +118,11 @@ class photoMaker:
|
||||
@classmethod
|
||||
def VALIDATE_INPUTS(cls, positivePrompt, negativePrompt):
|
||||
if (positivePrompt is not None and (positivePrompt == "" or len(positivePrompt) < 3 or len(positivePrompt) > 2000)):
|
||||
raise Exception("Positive Prompt Must Be Between 3 And 2000 characters!")
|
||||
raise Exception(
|
||||
"Positive Prompt Must Be Between 3 And 2000 characters!")
|
||||
if (negativePrompt is not None and negativePrompt != "" and (len(negativePrompt) < 3 or len(negativePrompt) > 2000)):
|
||||
raise Exception("Negative Prompt Must Be Between 3 And 2000 characters!")
|
||||
raise Exception(
|
||||
"Negative Prompt Must Be Between 3 And 2000 characters!")
|
||||
return True
|
||||
|
||||
def photoMaker(self, **kwargs):
|
||||
@@ -145,13 +145,13 @@ class photoMaker:
|
||||
clipSkip = kwargs.get("clipSkip", 0)
|
||||
seed = kwargs.get("seed")
|
||||
batchSize = kwargs.get("batchSize", 1)
|
||||
|
||||
|
||||
imageList = [rwUtils.convertTensor2IMG(image1)]
|
||||
if(image2 is not None):
|
||||
if (image2 is not None):
|
||||
imageList.append(rwUtils.convertTensor2IMG(image2))
|
||||
if(image3 is not None):
|
||||
if (image3 is not None):
|
||||
imageList.append(rwUtils.convertTensor2IMG(image3))
|
||||
if(image4 is not None):
|
||||
if (image4 is not None):
|
||||
imageList.append(rwUtils.convertTensor2IMG(image4))
|
||||
|
||||
genConfig = [
|
||||
@@ -176,14 +176,14 @@ class photoMaker:
|
||||
}
|
||||
]
|
||||
|
||||
if(negativePrompt is not None and negativePrompt != ""):
|
||||
if (negativePrompt is not None and negativePrompt != ""):
|
||||
genConfig[0]["negativePrompt"] = negativePrompt
|
||||
if(promptWeighting != "Disabled"):
|
||||
if(promptWeighting == "sdEmbeds"):
|
||||
if (promptWeighting != "Disabled"):
|
||||
if (promptWeighting == "sdEmbeds"):
|
||||
genConfig[0]["promptWeighting"] = "sdEmbeds"
|
||||
else:
|
||||
genConfig[0]["promptWeighting"] = "compel"
|
||||
|
||||
genResult = rwUtils.inferenecRequest(genConfig)
|
||||
images = rwUtils.convertImageB64List(genResult)
|
||||
return images
|
||||
return images
|
||||
|
||||
Reference in New Issue
Block a user