mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2026-05-05 01:40:09 +08:00
Update nodes.py
This commit is contained in:
parent
ef25bfcee0
commit
0cb0f87a6b
7
nodes.py
7
nodes.py
@ -3694,7 +3694,7 @@ class Intrinsic_lora_sampling:
|
|||||||
CATEGORY = "KJNodes"
|
CATEGORY = "KJNodes"
|
||||||
|
|
||||||
def onestepsample(self, model, lora_name, clip, vae, image, text, task):
|
def onestepsample(self, model, lora_name, clip, vae, image, text, task):
|
||||||
|
pbar = comfy.utils.ProgressBar(3)
|
||||||
encoded_latent, = VAEEncode.encode(self, vae, image[:,:,:,:3])
|
encoded_latent, = VAEEncode.encode(self, vae, image[:,:,:,:3])
|
||||||
sample = encoded_latent["samples"]
|
sample = encoded_latent["samples"]
|
||||||
noise = torch.zeros(sample.size(), dtype=sample.dtype, layout=sample.layout, device="cpu")
|
noise = torch.zeros(sample.size(), dtype=sample.dtype, layout=sample.layout, device="cpu")
|
||||||
@ -3702,6 +3702,7 @@ class Intrinsic_lora_sampling:
|
|||||||
prompt = task + "," + text
|
prompt = task + "," + text
|
||||||
print(prompt)
|
print(prompt)
|
||||||
positive, = CLIPTextEncode.encode(self, clip, prompt)
|
positive, = CLIPTextEncode.encode(self, clip, prompt)
|
||||||
|
pbar.update(1)
|
||||||
negative = positive #negative shouldn't do anything in this scenario
|
negative = positive #negative shouldn't do anything in this scenario
|
||||||
|
|
||||||
#custom model sampling to pass latent through as it is
|
#custom model sampling to pass latent through as it is
|
||||||
@ -3724,8 +3725,9 @@ class Intrinsic_lora_sampling:
|
|||||||
samples = {"samples": comfy.sample.sample(model_clone_with_lora, noise, 1, 1.0, "euler", "simple", positive, negative, sample,
|
samples = {"samples": comfy.sample.sample(model_clone_with_lora, noise, 1, 1.0, "euler", "simple", positive, negative, sample,
|
||||||
denoise=1.0, disable_noise=True, start_step=0, last_step=1,
|
denoise=1.0, disable_noise=True, start_step=0, last_step=1,
|
||||||
force_full_denoise=True, noise_mask=None, callback=None, disable_pbar=True, seed=None)}
|
force_full_denoise=True, noise_mask=None, callback=None, disable_pbar=True, seed=None)}
|
||||||
|
pbar.update(1)
|
||||||
image_out, = VAEDecode.decode(self, vae, samples)
|
image_out, = VAEDecode.decode(self, vae, samples)
|
||||||
|
pbar.update(1)
|
||||||
if task == 'depth map':
|
if task == 'depth map':
|
||||||
imax = image_out.max()
|
imax = image_out.max()
|
||||||
imin = image_out.min()
|
imin = image_out.min()
|
||||||
@ -3737,6 +3739,7 @@ class Intrinsic_lora_sampling:
|
|||||||
image_out = 1.0 - image_out
|
image_out = 1.0 - image_out
|
||||||
else:
|
else:
|
||||||
image_out = image_out.clamp(-1.,1.)
|
image_out = image_out.clamp(-1.,1.)
|
||||||
|
|
||||||
return (image_out, )
|
return (image_out, )
|
||||||
|
|
||||||
NODE_CLASS_MAPPINGS = {
|
NODE_CLASS_MAPPINGS = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user