GithubHelp home page GithubHelp logo

Comments (1)

zero41120 avatar zero41120 commented on June 2, 2024

Here is what I did to make CLIP interrogation work on my M3 Mac:

  1. First, I encountered the same error as you, seeing "Half" in the error message. My assumption is that something in the Mac configuration causes the system to use fp16 instead of fp32. Although I don't fully understand what fp16 and fp32 mean, here is the Mac config that gets loaded by default in A1111:
    export COMMANDLINE_ARGS="--skip-torch-cuda-test --upcast-sampling --no-half-vae --use-cpu interrogate"
  2. I learned that using the --no-half flag prevents the system from using fp16. So, following the instruction in the Mac file, go to this file:
    #export COMMANDLINE_ARGS=""
  3. Uncomment this line and use these flags:
export COMMANDLINE_ARGS="--skip-torch-cuda-test --upcast-sampling --no-half-vae --use-cpu interrogate --no-half"

This makes the interrogation work, and SD1.5 models generate images fine

However, on my 18GB M3 Mac, loading my favorite SDXL model causes the Python memory usage to increase from the usual 10GB to over 20GB, halting image generation. To use the SDXL model again, I have to remove the --no-half flag.


From my understanding, the M3 Mac uses a shared memory strategy, allowing both regular RAM and VRAM to use the same 18GB of RAM. However, when total usage exceeds 18GB, the system starts writing data to disk and swapping data between disk and RAM. This process is expensive and, since the SDXL Python process exceeds the 18GB supported by my Mac, even if the request is received, the swapping makes image generation impossible to complete in a reasonable time.

It's likely that the A1111 developers can fix this issue easily by making the interrogation use --no-half by default in the Mac environment, regardless of the flag. This change can be updated in this file:

if not shared.cmd_opts.no_half and not self.running_on_cpu:
.

from stable-diffusion-webui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.