Compare commits

...
5 Commits
Author SHA1 Message Date
Dr.Lt.Data 09ae2eaa9b KSamplerProgress fix and enhance
fix: ommit_start_latent - doesn't work if it is false
improve: add ommit_final_latent
modified: move progress latent to cpu
2024-08-04 11:22:35 +09:00
Dr.Lt.Data eab0b95df5 Merge pull request #134 from ComfyNodePRs/licence-update
Update PyProject Toml - License
2024-08-03 15:10:48 +09:00
snomiao badc1c0cb4 chore(licence-update): Update PyProject Toml - License 2024-08-02 23:03:51 +00:00
Dr.Lt.Data cf9bae0718 fix: LoadPrompts - invalid opiton handling of text_data_opt
https://github.com/ltdrdata/ComfyUI-Inspire-Pack/issues/124
2024-07-30 16:25:43 +09:00
Dr.Lt.Data c90d6c8d0f fix: WildcardEncodeInspire - external seed isn't passed to 2nd population. 2nd populated text isn't reflected to populated_text 2024-07-28 00:12:23 +09:00
4 changed files with 24 additions and 16 deletions
+1 -1
View File
@@ -7,7 +7,7 @@
import importlib
version_code = [0, 82, 4]
version_code = [0, 82, 7]
version_str = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '')
print(f"### Loading: ComfyUI-Inspire-Pack ({version_str})")
+5 -4
View File
@@ -121,7 +121,7 @@ class LoadPromptsFromFile:
prompts = []
try:
if text_data_opt is None:
if not text_data_opt:
with open(prompt_path, "r", encoding="utf-8") as file:
prompt_data = file.read()
else:
@@ -182,7 +182,7 @@ class LoadSinglePromptFromFile:
prompts = []
try:
if text_data_opt is None:
if not text_data_opt:
with open(prompt_path, "r", encoding="utf-8") as file:
prompt_data = file.read()
else:
@@ -463,8 +463,9 @@ class WildcardEncodeInspire:
"To use 'Wildcard Encode (Inspire)' node, 'Impact Pack' extension is required.")
raise Exception(f"[ERROR] To use 'Wildcard Encode (Inspire)', you need to install 'Impact Pack'")
model, clip, conditioning = nodes.NODE_CLASS_MAPPINGS['ImpactWildcardEncode'].process_with_loras(wildcard_opt=populated, model=kwargs['model'], clip=kwargs['clip'], clip_encoder=clip_encoder)
return (model, clip, conditioning, populated)
processed = []
model, clip, conditioning = nodes.NODE_CLASS_MAPPINGS['ImpactWildcardEncode'].process_with_loras(wildcard_opt=populated, model=kwargs['model'], clip=kwargs['clip'], seed=kwargs['seed'], clip_encoder=clip_encoder, processed=processed)
return (model, clip, conditioning, processed[0])
class MakeBasicPipe:
+16 -9
View File
@@ -24,6 +24,7 @@ class KSampler_progress(a1111_compat.KSampler_inspire):
"noise_mode": (["GPU(=A1111)", "CPU"],),
"interval": ("INT", {"default": 1, "min": 1, "max": 10000}),
"omit_start_latent": ("BOOLEAN", {"default": True, "label_on": "True", "label_off": "False"}),
"omit_final_latent": ("BOOLEAN", {"default": False, "label_on": "True", "label_off": "False"}),
},
"optional": {
"scheduler_func_opt": ("SCHEDULER_FUNC",),
@@ -36,7 +37,8 @@ class KSampler_progress(a1111_compat.KSampler_inspire):
RETURN_NAMES = ("latent", "progress_latent")
@staticmethod
def doit(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise, noise_mode, interval, omit_start_latent, scheduler_func_opt=None):
def doit(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise, noise_mode,
interval, omit_start_latent, omit_final_latent, scheduler_func_opt=None):
adv_steps = int(steps / denoise)
if omit_start_latent:
@@ -44,19 +46,20 @@ class KSampler_progress(a1111_compat.KSampler_inspire):
else:
result = [latent_image['samples']]
result = []
def progress_callback(step, x0, x, total_steps):
if (total_steps-1) != step and step % interval != 0:
return
x = model.model.process_latent_out(x)
x = x.to(model_management.intermediate_device())
x = x.cpu()
result.append(x)
latent_image, noise = a1111_compat.KSamplerAdvanced_inspire.sample(model, True, seed, adv_steps, cfg, sampler_name, scheduler, positive, negative, latent_image, (adv_steps-steps),
adv_steps, noise_mode, False, callback=progress_callback, scheduler_func_opt=scheduler_func_opt)
if not omit_final_latent:
result.append(latent_image['samples'].cpu())
if len(result) > 0:
result = torch.cat(result)
result = {'samples': result}
@@ -86,6 +89,7 @@ class KSamplerAdvanced_progress(a1111_compat.KSamplerAdvanced_inspire):
"return_with_leftover_noise": ("BOOLEAN", {"default": False, "label_on": "enable", "label_off": "disable"}),
"interval": ("INT", {"default": 1, "min": 1, "max": 10000}),
"omit_start_latent": ("BOOLEAN", {"default": False, "label_on": "True", "label_off": "False"}),
"omit_final_latent": ("BOOLEAN", {"default": False, "label_on": "True", "label_off": "False"}),
},
"optional": {
"prev_progress_latent_opt": ("LATENT",),
@@ -100,26 +104,29 @@ class KSamplerAdvanced_progress(a1111_compat.KSamplerAdvanced_inspire):
RETURN_TYPES = ("LATENT", "LATENT")
RETURN_NAMES = ("latent", "progress_latent")
def doit(self, model, add_noise, noise_seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, start_at_step, end_at_step,
noise_mode, return_with_leftover_noise, interval, omit_start_latent, prev_progress_latent_opt=None, scheduler_func_opt=None):
def doit(self, model, add_noise, noise_seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image,
start_at_step, end_at_step, noise_mode, return_with_leftover_noise, interval, omit_start_latent, omit_final_latent,
prev_progress_latent_opt=None, scheduler_func_opt=None):
if omit_start_latent:
result = []
else:
result = [latent_image['samples']]
result = []
def progress_callback(step, x0, x, total_steps):
if (total_steps-1) != step and step % interval != 0:
return
x = model.model.process_latent_out(x)
x = x.to(model_management.intermediate_device())
x = x.cpu()
result.append(x)
latent_image, noise = a1111_compat.KSamplerAdvanced_inspire.sample(model, add_noise, noise_seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, start_at_step, end_at_step,
noise_mode, False, callback=progress_callback, scheduler_func_opt=scheduler_func_opt)
if not omit_final_latent:
result.append(latent_image['samples'].cpu())
if len(result) > 0:
result = torch.cat(result)
result = {'samples': result}
+2 -2
View File
@@ -1,8 +1,8 @@
[project]
name = "comfyui-inspire-pack"
description = "This extension provides various nodes to support Lora Block Weight and the Impact Pack. Provides many easily applicable regional features and applications for Variation Seed."
version = "0.82.4"
license = "LICENSE"
version = "0.82.7"
license = { file = "LICENSE" }
dependencies = ["matplotlib", "cachetools"]
[project.urls]