comfyanonymous / ComfyUI_bitsandbytes_NF4

GNU Affero General Public License v3.0
319 stars 25 forks source link

.to() does not accept copy argument #10

Open Razunter opened 2 months ago

Razunter commented 2 months ago

Trying to use the node, but crashing:

Error occurred when executing SamplerCustomAdvanced:

.to() does not accept copy argument

  File "D:\Soft\StableDiffusion-StabilityMatrix\Data\Packages\ComfyUI\execution.py", line 152, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
  File "D:\Soft\StableDiffusion-StabilityMatrix\Data\Packages\ComfyUI\execution.py", line 82, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
  File "D:\Soft\StableDiffusion-StabilityMatrix\Data\Packages\ComfyUI\execution.py", line 75, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
  File "D:\Soft\StableDiffusion-StabilityMatrix\Data\Packages\ComfyUI\comfy_extras\nodes_custom_sampler.py", line 612, 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:\Soft\StableDiffusion-StabilityMatrix\Data\Packages\ComfyUI\comfy\samplers.py", line 706, in sample
    self.inner_model, self.conds, self.loaded_models = comfy.sampler_helpers.prepare_sampling(self.model_patcher, noise.shape, self.conds)
  File "D:\Soft\StableDiffusion-StabilityMatrix\Data\Packages\ComfyUI\comfy\sampler_helpers.py", line 66, in prepare_sampling
    comfy.model_management.load_models_gpu([model] + models, memory_required=memory_required, minimum_memory_required=minimum_memory_required)
  File "D:\Soft\StableDiffusion-StabilityMatrix\Data\Packages\ComfyUI\comfy\model_management.py", line 526, in load_models_gpu
    cur_loaded_model = loaded_model.model_load(lowvram_model_memory, force_patch_weights=force_patch_weights)
  File "D:\Soft\StableDiffusion-StabilityMatrix\Data\Packages\ComfyUI\comfy\model_management.py", line 325, in model_load
    raise e
  File "D:\Soft\StableDiffusion-StabilityMatrix\Data\Packages\ComfyUI\comfy\model_management.py", line 321, in model_load
    self.real_model = self.model.patch_model(device_to=patch_model_to, patch_weights=load_weights)
  File "D:\Soft\StableDiffusion-StabilityMatrix\Data\Packages\ComfyUI\comfy\model_patcher.py", line 349, in patch_model
    self.patch_weight_to_device(key, device_to)
  File "D:\Soft\StableDiffusion-StabilityMatrix\Data\Packages\ComfyUI\comfy\model_patcher.py", line 324, in patch_weight_to_device
    self.backup[key] = collections.namedtuple('Dimension', ['weight', 'inplace_update'])(weight.to(device=self.offload_device, copy=inplace_update), inplace_update)
  File "D:\Soft\StableDiffusion-StabilityMatrix\Data\Packages\ComfyUI\custom_nodes\ComfyUI_bitsandbytes_NF4\__init__.py", line 53, in to
    device, dtype, non_blocking, convert_to_format = torch._C._nn._parse_to(*args, **kwargs)

workflow Windows 11

Sokar commented 2 months ago

It doesn't work with Loras

Razunter commented 2 months ago

Hm... I thought it just ignores Lora, not crashes with it.

omarei commented 2 months ago

please someone find a workaround

ClothingAI commented 1 week ago

Forge it works!

zboing commented 1 week ago

It doesn't work with Loras

Actually it works, you need to connect the model to lora and the lora to the basic scheduler, not to the basic guider. Unfortunately I've noticed that the lora is not applied, it just doesn't give the error.

ClothingAI commented 1 week ago

It doesn't work with Loras

Actually it works, you need to connect the model to lora and the lora to the basic scheduler, not to the basic guider. Unfortunately I've noticed that the lora is not applied, it just doesn't give the error.

If its not applied, then it does not work then by definition no? Anyway with GGUF LORA actually works.