Code Monkey home page Code Monkey logo

Comments (4)

atiorh avatar atiorh commented on July 30, 2024

Looks like there is an inconsistent latent dimension that results in an inconsistent output resolution. Can you try reexporting with --latent-h 64 --latent-w 64 to make sure HF hub config files are overridden? (This will enforce 64x64 for latents and 512x512 for the output space)

from ml-stable-diffusion.

MenKuch avatar MenKuch commented on July 30, 2024

Thanks for your answer! I tried converting the model using

python -m python_coreml_stable_diffusion.torch2coreml --convert-unet --convert-text-encoder --convert-vae-decoder --convert-safety-checker --model-version digiplay/DreamShaper_8 -o <OUTPUTNAME> --bundle-resources-for-swift-cli --latent-h 64 --latent-w 64

and inference with

./StableDiffusionSample --resource-path <PATHTOMODEL> --compute-units cpuAndGPU --scheduler dpmpp "car"

and it now WORKS! THANKS!

But: omitting the cpuAndGPU flag so the model is run with the ANE sadly results in:

Error: Unable to compute the asynchronous prediction using ML Program. It can be an invalid input data or broken/unsupported model.

Tested this on a MacBook Pro M1 Max with macOS Sonoma 14.0 (23A344). StableDiffusionSample has been compiled with Xcode 15.

from ml-stable-diffusion.

atiorh avatar atiorh commented on July 30, 2024

Great! For ANE inference, you will need --compute-units cpuAndNeuralEngine

from ml-stable-diffusion.

MenKuch avatar MenKuch commented on July 30, 2024

Awesome, that works great. Thanks for your support. My models now run on CPU+GPU and ANE (if enough RAM is present).

But: Is it normal that on every app relaunch, ANECompilerService takes approx. 1 to 3 minutes to compile my model for ANE?

from ml-stable-diffusion.

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.