comfyanonymous / ComfyUI_experiments

Some experimental custom nodes.
GNU General Public License v3.0
159 stars 15 forks source link

reference_only is not work! #15

Open QiYusheng opened 10 months ago

QiYusheng commented 10 months ago

I have updata comfyUI. But it still doesn't work

`Error occurred when executing ReferenceOnlySimple:

Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument tensors in method wrapper_CUDA_cat)

File "C:\StableDiffusion\Blender_ComfyUI\ComfyUI\execution.py", line 153, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "C:\StableDiffusion\Blender_ComfyUI\ComfyUI\execution.py", line 83, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "C:\StableDiffusion\Blender_ComfyUI\ComfyUI\execution.py", line 76, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "C:\StableDiffusion\Blender_ComfyUI\ComfyUI\custom_nodes\ComfyUI_experiments\reference_only.py", line 37, in reference_only out_latent = torch.cat((reference["samples"], latent["samples"]))`

peter-bear commented 4 months ago

my solution (add these three lines to the file reference_only.py at line 23): device = torch.device('cuda:0') if torch.cuda.is_available() else 'cpu' latent["samples"] = latent["samples"].to(device=device) reference["samples"] = reference["samples"].to(device=device)