sipie800 / ComfyUI-PuLID-Flux-Enhanced

Apache License 2.0
79 stars 13 forks source link

Causing Boolean value of Tensor with more than one value is ambiguous in SamplerCustomAdvanced Node #4

Open CCJetWing opened 1 month ago

CCJetWing commented 1 month ago

Can anyone figure out how can I fix the error?

ComfyUI Error Report

Error Details

## System Information
- **ComfyUI Version:** v0.2.2-62-gdc96a1a
- **Arguments:** D:\ComfyUI-aki-v1.2\main.py --auto-launch --preview-method auto --disable-cuda-malloc
- **OS:** nt
- **Python Version:** 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
- **Embedded Python:** false
- **PyTorch Version:** 2.4.1+cu124
## Devices

- **Name:** cuda:0 NVIDIA GeForce RTX 3090 : cudaMallocAsync
  - **Type:** cuda
  - **VRAM Total:** 25769279488
  - **VRAM Free:** 5729001634
  - **Torch VRAM Total:** 18488492032
  - **Torch VRAM Free:** 116023458
## Logs

2024-10-18 20:55:34,482 - root - INFO - Total VRAM 24576 MB, total RAM 65447 MB 2024-10-18 20:55:34,482 - root - INFO - pytorch version: 2.4.1+cu124 2024-10-18 20:55:43,655 - root - INFO - xformers version: 0.0.28.post1 2024-10-18 20:55:43,655 - root - INFO - Set vram state to: NORMAL_VRAM 2024-10-18 20:55:43,655 - root - INFO - Device: cuda:0 NVIDIA GeForce RTX 3090 : cudaMallocAsync 2024-10-18 20:55:47,220 - root - INFO - Using xformers cross attention 2024-10-18 20:55:54,821 - root - INFO - [Prompt Server] web root: D:\ComfyUI-aki-v1.2\web 2024-10-18 20:56:42,682 - root - INFO - Total VRAM 24576 MB, total RAM 65447 MB 2024-10-18 20:56:42,682 - root - INFO - pytorch version: 2.4.1+cu124 2024-10-18 20:56:42,682 - root - INFO - xformers version: 0.0.28.post1 2024-10-18 20:56:42,682 - root - INFO - Set vram state to: NORMAL_VRAM 2024-10-18 20:56:42,682 - root - INFO - Device: cuda:0 NVIDIA GeForce RTX 3090 : cudaMallocAsync 2024-10-18 20:57:00,230 - root - INFO - -------------- 2024-10-18 20:57:00,230 - root - INFO -  ### Mixlab Nodes: Loaded 2024-10-18 20:57:00,304 - root - INFO - ChatGPT.available True 2024-10-18 20:57:00,321 - root - INFO - editmask.available True 2024-10-18 20:57:00,348 - root - INFO - LaMaInpainting.available True 2024-10-18 20:57:01,273 - root - INFO - ClipInterrogator.available True 2024-10-18 20:57:03,116 - root - INFO - PromptGenerate.available True 2024-10-18 20:57:03,116 - root - INFO - ChinesePrompt.available True 2024-10-18 20:57:03,116 - root - INFO - RembgNode.available True 2024-10-18 20:57:07,906 - root - INFO - TripoSR.available 2024-10-18 20:57:07,917 - root - INFO - MiniCPMNode.available 2024-10-18 20:57:08,417 - root - INFO - Scenedetect.available 2024-10-18 20:57:09,172 - root - INFO - FishSpeech.available 2024-10-18 20:57:09,274 - root - INFO - SenseVoice.available 2024-10-18 20:57:09,975 - root - INFO - Whisper.available False 2024-10-18 20:57:10,028 - root - INFO - FalVideo.available 2024-10-18 20:57:10,028 - root - INFO -  --------------  2024-10-18 20:57:10,155 - comfyui-prompt-control - INFO - Use STYLE(weight_interpretation, normalization) at the start of a prompt to use advanced encodings 2024-10-18 20:57:10,155 - comfyui-prompt-control - INFO - Weight interpretations available: comfy,perp 2024-10-18 20:57:10,155 - comfyui-prompt-control - INFO - Normalization types available: none

2024-10-18 20:58:00,106 - root - INFO - Import times for custom nodes: 2024-10-18 20:58:00,106 - root - INFO - 0.0 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\efficiency-nodes-comfyui 2024-10-18 20:58:00,106 - root - INFO - 0.0 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI_IPAdapter_plus 2024-10-18 20:58:00,106 - root - INFO - 0.0 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-VideoHelperSuite 2024-10-18 20:58:00,106 - root - INFO - 0.0 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\comfyui_controlnet_aux 2024-10-18 20:58:00,106 - root - INFO - 0.0 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\sdxl_prompt_styler 2024-10-18 20:58:00,107 - root - INFO - 0.0 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-Impact-Pack 2024-10-18 20:58:00,107 - root - INFO - 0.0 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\websocket_image_save.py 2024-10-18 20:58:00,107 - root - INFO - 0.0 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\AIGODLIKE-ComfyUI-Translation 2024-10-18 20:58:00,107 - root - INFO - 0.0 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\comfyui-ultralytics-yolo 2024-10-18 20:58:00,107 - root - INFO - 0.0 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ControlNet-LLLite-ComfyUI 2024-10-18 20:58:00,107 - root - INFO - 0.0 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\FreeU_Advanced 2024-10-18 20:58:00,107 - root - INFO - 0.0 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-WD14-Tagger 2024-10-18 20:58:00,107 - root - INFO - 0.0 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\rembg-comfyui-node-better 2024-10-18 20:58:00,107 - root - INFO - 0.0 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\comfyui-lama-remover 2024-10-18 20:58:00,107 - root - INFO - 0.0 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\stability-ComfyUI-nodes 2024-10-18 20:58:00,107 - root - INFO - 0.0 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI_InstantID 2024-10-18 20:58:00,107 - root - INFO - 0.0 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI_TiledKSampler 2024-10-18 20:58:00,107 - root - INFO - 0.0 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-Gaffer 2024-10-18 20:58:00,107 - root - INFO - 0.0 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\PowerNoiseSuite 2024-10-18 20:58:00,107 - root - INFO - 0.0 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-Eagle-PNGInfo 2024-10-18 20:58:00,107 - root - INFO - 0.1 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI_experiments 2024-10-18 20:58:00,107 - root - INFO - 0.1 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\comfyui-inpaint-nodes 2024-10-18 20:58:00,107 - root - INFO - 0.1 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI_UltimateSDUpscale 2024-10-18 20:58:00,107 - root - INFO - 0.1 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\images-grid-comfy-plugin 2024-10-18 20:58:00,107 - root - INFO - 0.1 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI_essentials 2024-10-18 20:58:00,107 - root - INFO - 0.1 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-Video-Matting 2024-10-18 20:58:00,107 - root - INFO - 0.1 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-KJNodes 2024-10-18 20:58:00,107 - root - INFO - 0.1 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\x-flux-comfyui 2024-10-18 20:58:00,107 - root - INFO - 0.1 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-IC-Light 2024-10-18 20:58:00,107 - root - INFO - 0.1 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-GGUF 2024-10-18 20:58:00,107 - root - INFO - 0.1 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-Custom-Scripts 2024-10-18 20:58:00,107 - root - INFO - 0.1 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\comfyui-prompt-control 2024-10-18 20:58:00,107 - root - INFO - 0.2 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI_CatVTON_Wrapper 2024-10-18 20:58:00,107 - root - INFO - 0.2 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\Derfuu_ComfyUI_ModdedNodes 2024-10-18 20:58:00,107 - root - INFO - 0.2 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-Advanced-ControlNet 2024-10-18 20:58:00,107 - root - INFO - 0.2 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-Marigold 2024-10-18 20:58:00,108 - root - INFO - 0.2 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-Florence2 2024-10-18 20:58:00,108 - root - INFO - 0.3 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-Inspire-Pack 2024-10-18 20:58:00,108 - root - INFO - 0.3 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\rgthree-comfy 2024-10-18 20:58:00,108 - root - INFO - 0.4 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-Crystools 2024-10-18 20:58:00,108 - root - INFO - 0.5 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-AnimateDiff-Evolved 2024-10-18 20:58:00,108 - root - INFO - 0.6 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\comfyui-workspace-manager 2024-10-18 20:58:00,108 - root - INFO - 0.7 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\comfyui_segment_anything 2024-10-18 20:58:00,108 - root - INFO - 0.7 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-IF_AI_tools 2024-10-18 20:58:00,108 - root - INFO - 0.8 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-segment-anything-2 2024-10-18 20:58:00,108 - root - INFO - 0.9 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-Manager 2024-10-18 20:58:00,108 - root - INFO - 1.0 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\comfy_mtb 2024-10-18 20:58:00,108 - root - INFO - 1.0 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\CharacterFaceSwap 2024-10-18 20:58:00,108 - root - INFO - 1.0 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-PuLID-Flux-Enhanced 2024-10-18 20:58:00,108 - root - INFO - 1.0 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\comfyui-reactor-node 2024-10-18 20:58:00,108 - root - INFO - 1.3 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\clipseg.py 2024-10-18 20:58:00,108 - root - INFO - 1.4 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI_LayerStyle 2024-10-18 20:58:00,108 - root - INFO - 2.5 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI_FizzNodes 2024-10-18 20:58:00,108 - root - INFO - 2.7 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-FluxTrainer 2024-10-18 20:58:00,108 - root - INFO - 4.6 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\was-node-suite-comfyui 2024-10-18 20:58:00,108 - root - INFO - 5.5 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-Image-Filters 2024-10-18 20:58:00,108 - root - INFO - 7.1 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-Inspyrenet-Rembg 2024-10-18 20:58:00,108 - root - INFO - 7.7 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI_Custom_Nodes_AlekPet 2024-10-18 20:58:00,108 - root - INFO - 12.4 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\comfyui-mixlab-nodes 2024-10-18 20:58:00,108 - root - INFO - 27.0 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI_Comfyroll_CustomNodes 2024-10-18 20:58:00,108 - root - INFO - 34.9 seconds: D:\ComfyUI-aki-v1.2\custom_nodes\comfyui-art-venture 2024-10-18 20:58:00,108 - root - INFO - 2024-10-18 20:58:00,177 - root - INFO -

2024-10-18 20:58:00,177 - root - INFO -

Starting server 2024-10-18 20:58:00,177 - root - INFO - To see the GUI go to: http://192.168.1.100:8188 or http://127.0.0.1:8188 2024-10-18 20:58:00,177 - root - INFO - To see the GUI go to: https://192.168.1.100:8189 or https://127.0.0.1:8189 2024-10-18 20:59:35,755 - root - INFO - got prompt 2024-10-18 21:00:03,067 - root - INFO - Using xformers attention in VAE 2024-10-18 21:00:03,068 - root - INFO - Using xformers attention in VAE 2024-10-18 21:00:18,569 - root - INFO - Loaded EVA02-CLIP-L-14-336 model config. 2024-10-18 21:00:18,624 - root - INFO - Shape of rope freq: torch.Size([576, 64]) 2024-10-18 21:00:22,016 - root - INFO - Loading pretrained EVA02-CLIP-L-14-336 weights (eva_clip). 2024-10-18 21:00:27,069 - root - INFO - incompatible_keys.missing_keys: ['visual.rope.freqs_cos', 'visual.rope.freqs_sin', 'visual.blocks.0.attn.rope.freqs_cos', 'visual.blocks.0.attn.rope.freqs_sin', 'visual.blocks.1.attn.rope.freqs_cos', 'visual.blocks.1.attn.rope.freqs_sin', 'visual.blocks.2.attn.rope.freqs_cos', 'visual.blocks.2.attn.rope.freqs_sin', 'visual.blocks.3.attn.rope.freqs_cos', 'visual.blocks.3.attn.rope.freqs_sin', 'visual.blocks.4.attn.rope.freqs_cos', 'visual.blocks.4.attn.rope.freqs_sin', 'visual.blocks.5.attn.rope.freqs_cos', 'visual.blocks.5.attn.rope.freqs_sin', 'visual.blocks.6.attn.rope.freqs_cos', 'visual.blocks.6.attn.rope.freqs_sin', 'visual.blocks.7.attn.rope.freqs_cos', 'visual.blocks.7.attn.rope.freqs_sin', 'visual.blocks.8.attn.rope.freqs_cos', 'visual.blocks.8.attn.rope.freqs_sin', 'visual.blocks.9.attn.rope.freqs_cos', 'visual.blocks.9.attn.rope.freqs_sin', 'visual.blocks.10.attn.rope.freqs_cos', 'visual.blocks.10.attn.rope.freqs_sin', 'visual.blocks.11.attn.rope.freqs_cos', 'visual.blocks.11.attn.rope.freqs_sin', 'visual.blocks.12.attn.rope.freqs_cos', 'visual.blocks.12.attn.rope.freqs_sin', 'visual.blocks.13.attn.rope.freqs_cos', 'visual.blocks.13.attn.rope.freqs_sin', 'visual.blocks.14.attn.rope.freqs_cos', 'visual.blocks.14.attn.rope.freqs_sin', 'visual.blocks.15.attn.rope.freqs_cos', 'visual.blocks.15.attn.rope.freqs_sin', 'visual.blocks.16.attn.rope.freqs_cos', 'visual.blocks.16.attn.rope.freqs_sin', 'visual.blocks.17.attn.rope.freqs_cos', 'visual.blocks.17.attn.rope.freqs_sin', 'visual.blocks.18.attn.rope.freqs_cos', 'visual.blocks.18.attn.rope.freqs_sin', 'visual.blocks.19.attn.rope.freqs_cos', 'visual.blocks.19.attn.rope.freqs_sin', 'visual.blocks.20.attn.rope.freqs_cos', 'visual.blocks.20.attn.rope.freqs_sin', 'visual.blocks.21.attn.rope.freqs_cos', 'visual.blocks.21.attn.rope.freqs_sin', 'visual.blocks.22.attn.rope.freqs_cos', 'visual.blocks.22.attn.rope.freqs_sin', 'visual.blocks.23.attn.rope.freqs_cos', 'visual.blocks.23.attn.rope.freqs_sin'] 2024-10-18 21:00:29,199 - root - INFO - Loading PuLID-Flux model. 2024-10-18 21:01:19,804 - root - INFO - model weight dtype torch.float8_e4m3fn, manual cast: torch.bfloat16 2024-10-18 21:01:19,804 - root - INFO - modeltype FLUX 2024-10-18 21:02:48,517 - root - INFO - Requested to load FluxClipModel 2024-10-18 21:02:48,517 - root - INFO - Loading 1 new model 2024-10-18 21:02:48,524 - root - INFO - loaded completely 0.0 4777.53759765625 True 2024-10-18 21:03:12,682 - root - WARNING - clip missing: ['text_projection.weight'] 2024-10-18 21:03:14,632 - root - INFO - Requested to load Flux 2024-10-18 21:03:14,632 - root - INFO - Loading 1 new model 2024-10-18 21:03:22,889 - root - INFO - loaded completely 0.0 13062.662170410156 True 2024-10-18 21:03:23,037 - root - ERROR - !!! Exception during processing !!! Boolean value of Tensor with more than one value is ambiguous 2024-10-18 21:03:23,148 - root - ERROR - Traceback (most recent call last): File "D:\ComfyUI-aki-v1.2\execution.py", line 323, in execute output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) File "D:\ComfyUI-aki-v1.2\execution.py", line 198, in get_output_data return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) File "D:\ComfyUI-aki-v1.2\execution.py", line 169, in _map_node_over_list process_inputs(input_dict, i) File "D:\ComfyUI-aki-v1.2\execution.py", line 158, in process_inputs results.append(getattr(obj, func)(inputs)) File "D:\ComfyUI-aki-v1.2\comfy_extras\nodes_custom_sampler.py", line 633, in sample samples = guider.sample(noise.generate_noise(latent), latent_image, sampler, sigmas, denoise_mask=noise_mask, callback=callback, disable_pbar=disable_pbar, seed=noise.seed) File "D:\ComfyUI-aki-v1.2\comfy\samplers.py", line 716, in sample output = self.inner_sample(noise, latent_image, device, sampler, sigmas, denoise_mask, callback, disable_pbar, seed) File "D:\ComfyUI-aki-v1.2\comfy\samplers.py", line 695, in inner_sample samples = sampler.sample(self, sigmas, extra_args, callback, noise, latent_image, denoise_mask, disable_pbar) File "D:\ComfyUI-aki-v1.2\comfy\samplers.py", line 600, in sample samples = self.sampler_function(model_k, noise, sigmas, extra_args=extra_args, callback=k_callback, disable=disable_pbar, self.extra_options) File "D:\ComfyUI-aki-v1.2\python\lib\site-packages\torch\utils_contextlib.py", line 116, in decorate_context return func(*args, kwargs) File "D:\ComfyUI-aki-v1.2\comfy\k_diffusion\sampling.py", line 155, in sample_euler denoised = model(x, sigma_hat * s_in, *extra_args) File "D:\ComfyUI-aki-v1.2\comfy\samplers.py", line 299, in call out = self.inner_model(x, sigma, model_options=model_options, seed=seed) File "D:\ComfyUI-aki-v1.2\comfy\samplers.py", line 682, in call return self.predict_noise(args, kwargs) File "D:\ComfyUI-aki-v1.2\comfy\samplers.py", line 685, in predict_noise return sampling_function(self.inner_model, x, timestep, self.conds.get("negative", None), self.conds.get("positive", None), self.cfg, model_options=model_options, seed=seed) File "D:\ComfyUI-aki-v1.2\comfy\samplers.py", line 279, in sampling_function out = calc_cond_batch(model, conds, x, timestep, model_options) File "D:\ComfyUI-aki-v1.2\comfy\samplers.py", line 228, in calc_cond_batch output = model.apply_model(inputx, timestep, c).chunk(batch_chunks) File "D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-Advanced-ControlNet\adv_control\utils.py", line 69, in apply_model_uncond_cleanup_wrapper return orig_apply_model(self, args, kwargs) File "D:\ComfyUI-aki-v1.2\comfy\model_base.py", line 142, in apply_model model_output = self.diffusion_model(xc, t, context=context, control=control, transformer_options=transformer_options, extra_conds).float() File "D:\ComfyUI-aki-v1.2\python\lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl return self._call_impl(args, kwargs) File "D:\ComfyUI-aki-v1.2\python\lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl return forward_call(*args, **kwargs) File "D:\ComfyUI-aki-v1.2\comfy\ldm\flux\model.py", line 159, in forward out = self.forward_orig(img, img_ids, context, txt_ids, timestep, y, guidance, control) File "D:\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-PuLID-Flux-Enhanced\pulidflux.py", line 111, in forward_orig if node_data['sigma_start'] >= timesteps >= node_data['sigma_end']: RuntimeError: Boolean value of Tensor with more than one value is ambiguous

2024-10-18 21:03:23,149 - root - INFO - Prompt executed in 200.66 seconds

## Attached Workflow
Please make sure that workflow does not contain any sensitive information such as API keys or passwords.

Workflow too large. Please manually upload the workflow from local file system.



## Additional Context
(Please add any additional context or steps to reproduce the error here)
sipie800 commented 1 month ago

do you load a workflow which used to work with the origin ComfyUI-PuLID-Flux ? perhaps comfyui load a old default value from that json, which is not compatible with my node. If so, please manually select every value for ApplyPulidFlux again.

andrewmunsell commented 1 month ago

I also ran into the same issue as OP. Not going to lie, this is way outside my normal field and I literally just ran the error through Claude so this code change may be completely non-sensical or break other things, but it did seem to work for me to get rid of the error when using SamplerCustomAdvanced with the cfg > 1

Patchfile:

From c5460c72bc7a02496050f5e0915971d16f5fcd4c Mon Sep 17 00:00:00 2001
From: Andrew Munsell <andrew@wizardapps.net>
Date: Wed, 23 Oct 2024 18:04:31 -0700
Subject: [PATCH] Fix issue

---
 pulidflux.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/pulidflux.py b/pulidflux.py
index e67e81f..f9a185b 100644
--- a/pulidflux.py
+++ b/pulidflux.py
@@ -108,7 +108,7 @@ def forward_orig(
             if i % self.pulid_double_interval == 0:
                 # Will calculate influence of all pulid nodes at once
                 for _, node_data in self.pulid_data.items():
-                    if node_data['sigma_start'] >= timesteps >= node_data['sigma_end']:
+                    if ((node_data['sigma_start'] >= timesteps) & (timesteps >= node_data['sigma_end'])).all():
                         img = img + node_data['weight'] * self.pulid_ca[ca_idx](node_data['embedding'], img)
                 ca_idx += 1

@@ -130,7 +130,7 @@ def forward_orig(
             if i % self.pulid_single_interval == 0:
                 # Will calculate influence of all nodes at once
                 for _, node_data in self.pulid_data.items():
-                    if node_data['sigma_start'] >= timesteps >= node_data['sigma_end']:
+                    if ((node_data['sigma_start'] >= timesteps) & (timesteps >= node_data['sigma_end'])).all():
                         real_img = real_img + node_data['weight'] * self.pulid_ca[ca_idx](node_data['embedding'], real_img)
                 ca_idx += 1
             img = torch.cat((txt, real_img), 1)
@@ -465,3 +465,5 @@ NODE_DISPLAY_NAME_MAPPINGS = {
     "PulidFluxEvaClipLoader": "Load Eva Clip (PuLID Flux)",
     "ApplyPulidFlux": "Apply PuLID Flux",
 }
+
+
-- 
2.43.0
925-Studio commented 3 weeks ago

I just encountered this same error when I tried to run a batch generation. If the value of batch is > 1, this error appears.

Mumudao commented 2 weeks ago

将负面条件换成impact pack插件里的"negtive cond placeholder"就行了,反正我是这样解决的

ShoWorld commented 1 week ago

我也遇到了與 OP 相同的問題。不會撒謊,這遠遠超出了我的正常領域,我實際上只是通過 Claude 運行了錯誤,因此此代碼更改可能完全無意義或破壞其他事情,但在將 SamplerCustomAdvanced 與 cfg > 1 一起使用時,它似乎確實對我有用

補丁檔案:

This method is useful. Update the .patch command in the \custom_nodes\ComfyUI-PuLID-Flux-Enhanced folder. After the update, batch size >1 also works fine.