continue-revolution / sd-webui-animatediff

AnimateDiff for AUTOMATIC1111 Stable Diffusion WebUI
Other
3.11k stars 258 forks source link

[Bug]: A tensor with all NaNs was produced in VAE without --no-half #352

Open coollofty opened 11 months ago

coollofty commented 11 months ago

Is there an existing issue for this?

Have you read FAQ on README?

What happened?

animate diff render a black image. If I started with command --no-half, then it is ok! --no-half-vae only is no effect, must together --no-half. But none of the other functions are available without --no-half.

Steps to reproduce the problem

The simplest way is to set the parameters for animation diff and draw a few frames

What should have happened?

black image

Commit where the problem happens

webui: extension:

What browsers do you use to access the UI ?

No response

Command Line Arguments

--theme dark --xformers --xformers-flash-attention --no-half-vae --opt-channelslast --api --listen

Console logs

Traceback (most recent call last):
      File "G:\sd-std\modules\call_queue.py", line 57, in f
        res = list(func(*args, **kwargs))
      File "G:\sd-std\modules\call_queue.py", line 36, in f
        res = func(*args, **kwargs)
      File "G:\sd-std\modules\txt2img.py", line 55, in txt2img
        processed = processing.process_images(p)
      File "G:\sd-std\modules\processing.py", line 734, in process_images
        res = process_images_inner(p)
      File "G:\sd-std\extensions\sd-webui-animatediff\scripts\animatediff_cn.py", line 119, in hacked_processing_process_images_hijack
        return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs)
      File "G:\sd-std\modules\processing.py", line 877, in process_images_inner
        x_samples_ddim = decode_latent_batch(p.sd_model, samples_ddim, target_device=devices.cpu, check_for_nans=True)
      File "G:\sd-std\modules\processing.py", line 603, in decode_latent_batch
        raise e
      File "G:\sd-std\modules\processing.py", line 600, in decode_latent_batch
        devices.test_for_nans(sample, "vae")
      File "G:\sd-std\modules\devices.py", line 193, in test_for_nans
        raise NansException(message)

modules.devices.NansException: A tensor with all NaNs was produced in VAE. Use --disable-nan-check commandline argument to disable this check.

Additional information

No response

coollofty commented 11 months ago

I means that my base model is fp16, and when using animate diff, it is must add both -- no-half and -- no-half-vae at the same time, otherwise an "A tensor with all NaNs was produced in VAE" error will occur. Is there a solution to this?

PentagramPro commented 11 months ago

I have same issue

eduardonba1 commented 11 months ago

I have the same problem sometimes i kept pressing generate and worked lol

SeanBannister commented 10 months ago

I get this error when I set "Number of frames" to 3 while FPS was set to 30. Setting my "Number of frames" higher than my FPS fixed this.

NaughtDZ commented 8 months ago

I means that my base model is fp16, and when using animate diff, it is must add both -- no-half and -- no-half-vae at the same time, otherwise an "A tensor with all NaNs was produced in VAE" error will occur. Is there a solution to this?

Same problem here,and no solution by now as I know....

continue-revolution commented 8 months ago

@SeanBannister describes the way to resolve this issue. This issue is actually the same as https://github.com/continue-revolution/sd-webui-animatediff/issues/213#issuecomment-1763949336 here (an older issue). Unfortunately there is no solution. Please always keep your "Number of frames" to be greater than or equal to your "Context batch size".