Giter VIP home page Giter VIP logo

Comments (6)

tgberkeley avatar tgberkeley commented on June 2, 2024 1

Hi @milochen0418 great this is a great point. I am just about to submit a PR that will also allow you to run this with only a CPU on a mac. It will take about 4/5 minutes per image if running on a cpu only and running for 30 inference steps.

To speed this up further you can make the image smaller, by changing the width parameter in image_style inside of styles.py, or you can reduce the number of inference steps further.
Hope this helps.

from reflex-examples.

milochen0418 avatar milochen0418 commented on June 2, 2024

Some question related to this issue
https://stackoverflow.com/questions/72313510/runtimeerror-the-mps-backend-is-supported-on-macos-12-3-current-os-version-can

from reflex-examples.

milochen0418 avatar milochen0418 commented on June 2, 2024

More reference
oobabooga/text-generation-webui#1337

from reflex-examples.

milochen0418 avatar milochen0418 commented on June 2, 2024

After click Generate New Image, it will use img2img_mac.py
Right now, the current code only support mps

Apple Metal Performance Shaders (MPS)
The MPS backend extends the PyTorch framework by providing scripts and capabilities to set up and run operations on Mac. MPS optimizes compute performance with kernels that are fine-tuned for the unique characteristics of each Metal GPU family.

Hi @tgberkeley , Is it possible to run on the CPU?

from reflex-examples.

milochen0418 avatar milochen0418 commented on June 2, 2024

Hi @milochen0418 great this is a great point. I am just about to submit a PR that will also allow you to run this with only a CPU on a mac. It will take about 4/5 minutes per image if running on a cpu only and running for 30 inference steps.

To speed this up further you can make the image smaller, by changing the width parameter in image_style inside of styles.py, or you can reduce the number of inference steps further. Hope this helps.

Hi @tgberkeley,
You are so nice.
It's wonderful to have your code. Let everyone enjoy the stable diffusion of pynecone app.
It works on my old Mac with CPU only from this PR

And the following is my testing result

You say it takes 0.8 minutes for 30 inference steps.
In my case, I set Number of inference steps as 100 and Strength of diffusion as 70 in the running app.
Does that mean it needs 100*70 inference steps?
Is my understanding correct?
Thanks

from reflex-examples.

milochen0418 avatar milochen0418 commented on June 2, 2024

Bug solved by

from reflex-examples.

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.