How to Fix Common Warnings When Installing Stable Diffusion on Your Mac

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ก.ย. 2024
  • In this video, you will learn how to fix warnings that may arise when initializing Stable Diffusion on a Mac locally. Using the WARP terminal, you will be guided through the steps needed to troubleshoot and resolve these warnings, which can cause issues when generating images.
    Warnings:
    (1) Torch not compiled with CUDA enabled, memory monitor disabled
    (2) No module 'xformers'. Proceeding without it
    (3) You are running torch 1.12.1. The program is tested to work with torch 1.13.1
    (4) Failed to load image Python extension
    📣📣📣I have just opened a Discord page to discuss SD and AI Art - common issues and news - join using the link: / discord
    🤙🏻 Follow me on Medium to get my Newsletter:
    - Get UNLIMITED access to all articles: / membership
    - Laura: / lauracarnevali
    - Intelligent Art: / intelligent
    📰Article:
    / how-to-fix-common-warn...
    📌 Links:
    Warp: app.warp.dev/r...
    Pytorch: pytorch.org
    00:18 Warp Terminal
    03:35 Warning (1) Torch not compiled with CUDA enabled, memory monitor disabled
    05:45 Warning (2) No module 'xformers'. Proceeding without it
    06:49 Warning (3) You are running torch 1.12.1. The program is tested to work with torch 1.13.1
    09:21 Warning (4) Failed to load image Python extension
    11:13 Final thoughts
    #aiart #stablediffusion #generativeart

ความคิดเห็น • 92

  • @JulienTaillez
    @JulienTaillez ปีที่แล้ว +1

    ahhh perfect, thank you for guiding us into upgrading torch, was unsuccessful until now.

  • @MarkDMongie
    @MarkDMongie ปีที่แล้ว

    Thank you Laura! I have watched about 5 of your videos as I have struggled to get my Mac M1 Mini running SD. This was the last issue to resolve that was causing crashes and running out of memory, despite have 16GB. Subscribed! Keep doing your great work, and I hope Google send you paychecks :)

  • @muffin6758
    @muffin6758 ปีที่แล้ว +1

    Thank you so much!!!! You help me fix the Torch error. Now I can run models that were not running before. I appreciate it!!

    • @Elyas885
      @Elyas885 9 หลายเดือนก่อน

      🤣🤣

  • @theRubberDuckiee
    @theRubberDuckiee ปีที่แล้ว +1

    This is such a cool use of the terminal to debug errors :O

  • @John_Krone
    @John_Krone ปีที่แล้ว +1

    This helped me!! Thanks for this video

  • @jamesbriggs
    @jamesbriggs ปีที่แล้ว +2

    great video! Never used warp AI before but might start now lol

    • @warpdotdev
      @warpdotdev ปีที่แล้ว +1

      We'd love to collaborate with you if you give Warp a try! Let's connect.

  • @AurelioLa-lz7mw
    @AurelioLa-lz7mw ปีที่แล้ว +1

    thanks, this helped me lots!

  • @bartolorosario
    @bartolorosario ปีที่แล้ว +1

    Hello Laura! Congrats for such a nice SD channel. i'd love to ask you, considering all the issues with apple managing SD would you recommend buying a m2 macbook? are they fast enough generating images and trainning lora models? or it's much better a nvidia rtx 4090 laptop for that matter? thanks in advance for your answer!

    • @LaCarnevali
      @LaCarnevali  ปีที่แล้ว +1

      Go for Windows, 100%. Otherwise, use an external provider

  • @arpaci
    @arpaci 7 หลายเดือนก่อน

    You are amazing, Thank you

  • @kathrinbaumbach8396
    @kathrinbaumbach8396 ปีที่แล้ว

    Amazing, great help, thank you!

  • @tesko93
    @tesko93 ปีที่แล้ว +2

    Grandissima!

  • @andrewstephens9787
    @andrewstephens9787 11 หลายเดือนก่อน

    i appreciate these videos so much

  • @ShyBoyEnt
    @ShyBoyEnt ปีที่แล้ว +1

    Does the M2 silicon base model have any problems installing and running stable diffusion locally?

  • @baumdeswissens
    @baumdeswissens ปีที่แล้ว +1

    thanks

  • @thomassynths
    @thomassynths ปีที่แล้ว

    For what its worth, xformers gives me consistent results as when not using it.

  • @sirisaacnewton998
    @sirisaacnewton998 ปีที่แล้ว

    Tanks for the content. I just Subscribed to the chanel. I'm the 1000 subscriber! Ciao

  • @edmundw
    @edmundw ปีที่แล้ว

    this video is awesome!! Do you mind showing how to install controlnet on an arm based Mac?

    • @LaCarnevali
      @LaCarnevali  ปีที่แล้ว

      Hi, thanks :) I think you can follow this video at minute 9:52 :
      th-cam.com/video/SktvO_OtnOQ/w-d-xo.html&lc=Ugy_uB96bT3C8-Lc4Xx4AaABAg

    • @edmundw
      @edmundw ปีที่แล้ว

      @@LaCarnevali I'm getting ERROR: Could not find a version that satisfies the requirement mediapipe==0.9.1.0 (from versions: 0.9.3.0) after installing controlnet. =(

    • @LaCarnevali
      @LaCarnevali  ปีที่แล้ว

      @@edmundw I found this on Stack Overflow - stackoverflow.com/questions/70061068/could-not-find-a-version-that-satisfies-the-requirement-mediapipe-from-versions
      I would try with the approved answer

  • @aligirl4204
    @aligirl4204 หลายเดือนก่อน

    Well explained, but I am stuck on 'zsh: no such file or directory: ./webui.sh'. I do not know what to do. Any suggestion would be highly appreciated

  • @VimalVinod-qg6mr
    @VimalVinod-qg6mr ปีที่แล้ว

    Hi there, Thanks for the video Laura. I installed on my MacBook M2 laptop and it worked fine.
    For some reason when I tried installing it on my M1 Max Machine.
    I'm getting this error:
    RuntimeError: "LayerNormKernelImpl" not implemented for 'Half'"
    Is there any fix for this? It would be really helpful.

    • @LaCarnevali
      @LaCarnevali  ปีที่แล้ว +2

      Hi, yes, you need to run the webui file with the following command:
      ./webui.sh --no-half

    • @VimalVinod-qg6mr
      @VimalVinod-qg6mr ปีที่แล้ว

      @@LaCarnevali Thank you so much, Laura. This did help!!!
      Have a nice day. :)

  • @ManelBarros
    @ManelBarros ปีที่แล้ว

    in your opinion which is better, Stable Diffusion locally on mac? or on Google Colab? great video by the way!! 😃

    • @LaCarnevali
      @LaCarnevali  ปีที่แล้ว

      It depends on which Mac you have as Stable Diffusion requires lots of power. If you have a Mac air, for example, Colab is way faster, mainly when training.

    • @ManelBarros
      @ManelBarros ปีที่แล้ว

      @@LaCarnevali with M1 max and 32gb of ram 🤔

    • @LaCarnevali
      @LaCarnevali  ปีที่แล้ว

      @@ManelBarros Hi Manel, I was searching online and people seem to be not fully happy with the performance. I would suggest you to try both (locally and colab) and see which one is faster.
      Limitation with Mac:
      - No support of NVIDIA GPU, so slow performance,
      - Space on disk, as SD is quite heavy.
      Limitation you have with colab are :
      - GPU is limited (you can buy more if needed),
      - the notebook cannot run for more than 12hours.
      - Space on Drive, but you can buy space on Google Drive.

  • @daviddouglassarustudios4688
    @daviddouglassarustudios4688 ปีที่แล้ว +1

    This is my Error
    A tensor with all NaNs was produced in Unet. This could be either because there's not enough precision to represent the picture, or because your video card does not support half type. Try setting the "Upcast cross attention layer to float32" option in Settings > Stable Diffusion or using the --no-half commandline argument to fix this. Use --disable-nan-check commandline argument to disable this check.
    Any Idea how I can solve this?

    • @LaCarnevali
      @LaCarnevali  ปีที่แล้ว +2

      Hi David, I think you can try using --no-half with running the webui.sh file :
      ./webui.sh --no-half

  • @fullflowstudios
    @fullflowstudios ปีที่แล้ว +1

    Laura your google colab script runs all the way without error up to the point where I start stable diffusion but then I get the message: Traceback (most recent call last): from fastapi import FastApi ModuleNotFoundError: No module named 'fastapi' . I followed your instructions to the letter. Where do I go wrong?

    • @LaCarnevali
      @LaCarnevali  ปีที่แล้ว

      Hi Hans, this error occurs when you are not in the right environment.
      I rerun it this morning, and it's working okay - try restarting and rerunning and let me know if it still doesn't work.

  • @SityClipz
    @SityClipz ปีที่แล้ว

    can you do a video on embedding and training your own data set to stable diffusion in goole colab

  • @hayksedrakyan1086
    @hayksedrakyan1086 ปีที่แล้ว

    How can I fix this error: Error: '"compute_indices_weights_cubic" not implemented for 'Half''. Check your schedules/ init values please. Also make sure you don't have a backwards slash in any of your PATHs - use / instead of \. Full error message is in your terminal/ cli.
    Thanks 😇

    • @LaCarnevali
      @LaCarnevali  ปีที่แล้ว +1

      Run the webui with the command --no-half, i.e.,
      ./webui.sh --no-half

    • @hayksedrakyan1086
      @hayksedrakyan1086 ปีที่แล้ว +1

      @@LaCarnevali Thanks !!!

  • @sergey_kuryshin
    @sergey_kuryshin ปีที่แล้ว

    Hello. Why are my upscales not working? Gives constant errors

  • @yanchen_
    @yanchen_ ปีที่แล้ว

    hi, i wonder if you could explain this [AttributeError: 'NoneType' object has no attribute 'pop'] it happened when i try to generate the image, and no image has been generated. Thank you!

    • @LaCarnevali
      @LaCarnevali  ปีที่แล้ว

      try running the webui with this argument:
      --disable-safe-unpickle
      i.e., ./webui.sh --disable-safe-unpickle

  • @abobsing
    @abobsing 7 หลายเดือนก่อน

    someone to help please
    TypeError: Cannot convert a MPS Tensor to float64 dtype as the MPS framework doesn't support float64. Please use float32 instead.

    • @LaCarnevali
      @LaCarnevali  5 หลายเดือนก่อน

      Unfortunately, SD is low performing on Mac and can take ages (or never) to run it! I would recommend to use an external GPU (e.g., Colab, RunPod) or external platforms (e.g., DiffusionHub, ThinkDiffusion).

  • @axelodontebob8620
    @axelodontebob8620 ปีที่แล้ว

    i get a RuntimeError: "LayerNormKernelImpl" not implemented for 'Half'
    after doing all this and i open the program

    • @LaCarnevali
      @LaCarnevali  ปีที่แล้ว

      I have got back to you on the other comment :) - posting the same below:
      Have you updated to the latest MacOS?
      If yes, try the following:
      run the ./webui adding --precision full --no-half, i.e.,
      ./webui.sh --precision full --no-half

    • @axelodontebob8620
      @axelodontebob8620 ปีที่แล้ว

      But I might be wrong and hopefully won’t break anything if I update now that it works to the latest Mac os

  • @bot2.078
    @bot2.078 ปีที่แล้ว

    Hello, I am receiving this error on a M1 & wondering if you can help me. Also, should I use warp terminal? RuntimeError: MPS backend out of memory (MPS allocated: 7.41 GB, other allocations: 1.45 GB, max allowed: 9.07 GB). Tried to allocate 256.00 MB on private pool. Use PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.0 to disable upper limit for memory allocations (may cause system failure).

    • @bot2.078
      @bot2.078 ปีที่แล้ว

      this was warp's answer: [export PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.5] First time using warp terminal for me. Would I just insert the code in the warp terminal?

    • @bot2.078
      @bot2.078 ปีที่แล้ว

      or should I just follow these steps in this video 😂

  • @ococococococ
    @ococococococ ปีที่แล้ว

    Hey Laura, I'm getting this error: "Stable diffusion model failed to load" Im not sure which step I did wrong.
    I have a iMac w/ 3 GHz 6-Core Intel Core i5 & 16 GB ram. Please help me out!! Thank you.

    • @LaCarnevali
      @LaCarnevali  ปีที่แล้ว

      This might help:
      windowsreport.com/stable-diffusion-model-failed-to-load-exiting/#:~:text=The%20Stable%20Diffusion%20model%20failed,Virtual%20RAM)%20did%20the%20trick.

    • @ococococococ
      @ococococococ ปีที่แล้ว

      @@LaCarnevali perfetto!

  • @Smartearningswaida
    @Smartearningswaida ปีที่แล้ว

    I have Mac and had an issue setting up stable diffusion
    finally, I did it from the terminal and I was there
    but for the first time when I wanted to try and see how it generates the image I got this error:
    RuntimeError: "upsample_nearest2d_channels_last" not implemented for 'Half'
    Time taken: 0.74s
    ? I even edited the command for stable diffusion for no halftime script and updated the Python version but no luck is there any other way

    • @LaCarnevali
      @LaCarnevali  ปีที่แล้ว +1

      Ehy, I replied on the other comment - it might be related to mac updates

  • @TheSoggetto
    @TheSoggetto ปีที่แล้ว

    Hey! Could you tell me what's this warning about: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
    warnings.warn('resource_tracker: There appear to be %d '

    • @LaCarnevali
      @LaCarnevali  ปีที่แล้ว

      Hi, I just seen this comment - sorry. Have you sorted?

    • @DivulgeD-fx5bz
      @DivulgeD-fx5bz ปีที่แล้ว

      Hi @@LaCarnevali i have the same error. It started recently, not sure what changed,

  • @howardchang1655
    @howardchang1655 ปีที่แล้ว

    whenever I start using stable diffusion, my python quits unexpectedly and it stopped working, any clues?

    • @howardchang1655
      @howardchang1655 ปีที่แล้ว

      error: input types 'tensor' and 'tensor' are not broadcast compatible

    • @LaCarnevali
      @LaCarnevali  ปีที่แล้ว

      Try to run the file with --no-half, i.e.,
      ./webui.sh --no-half

  • @eternalessence2998
    @eternalessence2998 ปีที่แล้ว +1

    everything works fine until I try to generate an image it says that python has unexpectedly crashed

    • @LaCarnevali
      @LaCarnevali  ปีที่แล้ว

      Hi, try to install libraries in the requirements.txt file in the venv environment.
      Follow the steps below after going in the stable-diffusion-webui folder:
      1) source venv/bin/activate
      2) pip install -r requirements.txt
      3) ./webui.sh

    • @eternalessence2998
      @eternalessence2998 ปีที่แล้ว

      Hey, thank you so much for replying 🙏, I tried what you described and still nothing worked, I ended up finding a forum saying to add -no-half and that worked although the rendering is really slow, do you have any suggestions to calibrate the settings to run a bit more efficiently on a MBP M1?

    • @LaCarnevali
      @LaCarnevali  ปีที่แล้ว

      @@eternalessence2998 Unfortunately no.
      I've got the following from GitHub, but I am not sure it will help - otherwise I would suggest using colab/runpod/paperspace...
      Poor Performance:
      Currently GPU acceleration on macOS uses a lot of memory. If performance is poor (if it takes more than a minute to generate a 512x512 image with 20 steps with any sampler) first try starting with the --opt-split-attention-v1 command line option (i.e. ./webui.sh --opt-split-attention-v1) and see if that helps. If that doesn't make much difference, then open the Activity Monitor application located in /Applications/Utilities and check the memory pressure graph under the Memory tab. If memory pressure is being displayed in red when an image is generated, close the web UI process and then add the --medvram command line option (i.e. ./webui.sh --opt-split-attention-v1 --medvram). If performance is still poor and memory pressure still red with that option, then instead try --lowvram (i.e. ./webui.sh --opt-split-attention-v1 --lowvram). If it still takes more than a few minutes to generate a 512x512 image with 20 steps with with any sampler, then you may need to turn off GPU acceleration. Open webui-user.sh in Xcode and change #export COMMANDLINE_ARGS="" to export COMMANDLINE_ARGS="--skip-torch-cuda-test --no-half --use-cpu all".

  • @EddieLeFunkMusic
    @EddieLeFunkMusic ปีที่แล้ว

    I use a m1 Mac but ffmpeg doesn't work it don't give me any videos only pics

    • @LaCarnevali
      @LaCarnevali  ปีที่แล้ว +1

      I know, ffmpeg has to be downloaded separately. You might install it with homebrew.
      Anyway, I am not sure you'll be happy with the M1 performance. You might want to use Google Colab or another external GPU to run Stable Diffusion. It will change A LOT.

    • @EddieLeFunkMusic
      @EddieLeFunkMusic ปีที่แล้ว

      @@LaCarnevali do you use a external gpu ?

    • @LaCarnevali
      @LaCarnevali  ปีที่แล้ว +1

      @@EddieLeFunkMusic yes, Colab

  • @Luxeduardo
    @Luxeduardo ปีที่แล้ว

    Hi, I have this problem RuntimeError: "LayerNormKernelImpl" not implemented for 'Half' what should i do ?

    • @LaCarnevali
      @LaCarnevali  ปีที่แล้ว

      Hi Lucas,
      Have you updated to the latest MacOS?
      If yes, try the following:
      In either the webui-user.bat or webui-user.sh add the below to the COMMANDLINE_ARGS= variable:
      --precision full --no-half
      Let me know if it works :)

    • @LiuPorpoise
      @LiuPorpoise ปีที่แล้ว

      it doesn't work@@LaCarnevali

  • @DJBAF85
    @DJBAF85 8 หลายเดือนก่อน

    Maybe it's something silly but I get the following error, and I have no idea how to fix it. ERROR> zsh: permission denied: stable-diffusion-webui/

  • @charlieayres-taylor6139
    @charlieayres-taylor6139 ปีที่แล้ว

    is there a place where problems with running stable diffusion are discussed? I currently have it installed and will open the webui, but will not generate any images coming up with a error python error of some kind?

    • @LaCarnevali
      @LaCarnevali  ปีที่แล้ว

      Hi! :) What is the error exactly? Does it come up when you press the "generate" button?

    • @charlieayres-taylor6139
      @charlieayres-taylor6139 ปีที่แล้ว

      @@LaCarnevali Hi laura thank-you so much for replying. I have installed following your guide. Yes the error comes up when i hit generate. from what i can tell it says there is a crashed thread (thread 16), "crashed with ARM thread state (64bit). the only thing i can see thats different is for me is my warp does not show (base). Hopefully that makes sense !! :)

    • @LaCarnevali
      @LaCarnevali  ปีที่แล้ว

      @@charlieayres-taylor6139 okay. Try the following.
      1) Go into the main directory stable-diffusion-webui.
      2) change the environment:
      source venv/bin/activate
      3) install requirements:
      pip install -r requirements.txt
      4) initialise SD
      ./webui.sh

    • @charlieayres-taylor6139
      @charlieayres-taylor6139 ปีที่แล้ว

      @@LaCarnevali Hi thankyou for all your help so far:). Unfourtunately that did not work, I am still getting the following: " error: input types 'tensor' and 'tensor' are not broadcast compatible" when i press the generate button. I have had a little look online but still cant fix the problem, as i dont really know anything about coding.

    • @LaCarnevali
      @LaCarnevali  ปีที่แล้ว +1

      @@charlieayres-taylor6139 okay, now run the webui with the argument --no-half:
      ./webui.sh --no-half

  • @thecorporategoose14
    @thecorporategoose14 6 หลายเดือนก่อน

    Struggled to focus, cute as hell :)

  • @axelodontebob8620
    @axelodontebob8620 ปีที่แล้ว

    laura!!! i think i went like three steps back this morning after trying to add dreambooth to my computer....
    my computer now says i am back to version 1.12.1 of torch whilst yesterday it worked with 2.0.0 and when i try the same steps to fix like in your video it says ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
    torchvision 0.13.1 requires torch==1.12.1, but you have torch 1.13.1 which is incompatible.
    Successfully installed torch-1.13.1
    the thing is that after i try to run the program once more it still says i am running 1.12.1
    helpppp

    • @axelodontebob8620
      @axelodontebob8620 ปีที่แล้ว

      i went to terminal and typed pip install torchvision==0.15.1 and it worked,
      it is the torchvision that is compatible with torch 1.13.1 and the program will run properly using both updated torch and torchvision if one manually does both if you are in my situation that torchvision doesnt seem compatible

  • @EddieLeFunkMusic
    @EddieLeFunkMusic ปีที่แล้ว

    and 3d doesn't work too :(

  • @theanimaster
    @theanimaster 10 หลายเดือนก่อน

    I installed ControlNet on my M2 Mac mini and getting the error: TypeError: Cannot convert a MPS Tensor to float64 dtype as the MPS framework doesn't support float64. Please use float32 instead. -- how to fix this??