comfyanonymous / ComfyUI_bitsandbytes_NF4

GNU Affero General Public License v3.0
335 stars 29 forks source link

.to() does not accept copy argument #10

Open Razunter opened 3 months ago

Razunter commented 3 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 3 months ago

It doesn't work with Loras

Razunter commented 3 months ago

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

omarei commented 3 months ago

please someone find a workaround

ClothingAI commented 1 month ago

Forge it works!

zboing commented 1 month 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 month 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.

Sujalron1 commented 2 weeks 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.

may be use tignometry toslove this https://worker-autumn-block-f695.wayode2908.workers.dev/c20e246bf83d536b764d4e99e8628a580840eba00f0330b28620aa6f947ff6a071379c2b44183495a3f2ef2b1b3d80551c5b278134188b37884a02c6c23294fdd3a9b8a893d45a41c7e251991091c3e02194e021a39765edd36fd498f797857f5568732590f0ed5b31f8b9da33d487fd30b784d8331d941e0c6c93fd49af092d4e6665861ef875eda3ebca7467f9591d1e8c7b6a1f45a86e097477d29522f4706788d27f6fa86229a73b0c3f8cd64a58::bcead84ca37ff799edb1b2bad7ceb5c8/Pirates%20of%20the%20Caribbean%20%20Dead%20Men%20Tell%20No%20Tales%20(2017)%202160p%20UHD%20BluRay%20x265%20HEVC%20[Org%20Hindi%20BD%205.1%20640Kbps%20%20English%20DD%205.1]%20ESub%20%20Immortal.mkv