Comments (31)
with export DEVICE=mps 512x512/ 4 steps / 1.57 seconds
from fastsdcpu.
I was wondering the same thing so I knocked up a quick Diffusers script for a 512x512 image running on a 8gb MacMini M1
on CPU float32 - 10/10 [00:46<00:00, 4.70s/it]
for MPS using float16* - 10/10 [00:18<00:00, 1.84s/it]
Note it starts slow and gets quicker so less steps would be slower per iteration (but faster over all)
it seems to peak at around 1.99s/iter on the CPU
*float32 MPS requires the use of swap space on my MacMini so SSD access slowed it down
but for completeness I got 10/10 [02:30<00:00, 15.10s/it]
On a 16Gb M1/2 it would be significantly faster.
from fastsdcpu.
install it on my MBP M2+ running around 2.82s/it on a 512x768 generated image , if you need any specific test let me know , was able to generate 10 images at the same time at around 20s/it
from fastsdcpu.
everything seems to work right , yes desktop gui . 512x512 / 4 steps / 10.49 seconds
from fastsdcpu.
from fastsdcpu.
from fastsdcpu.
from fastsdcpu.
@rupeshs no problem , feel free if you need any other things. one thing , using OpeVINO ended with error ,actually, i don't know what is it for
OSError: /Users/lucvaligny/.cache/huggingface/hub/models--deinferno--LCM_Dreamshaper_v7-openvino/snapshots/62289fd6f0dcdde26d7e86cba0e50815611a5c6d does not appear to have a file named preprocessor_config.json. Checkout 'https://huggingface.co//Users/lucvaligny/.cache/huggingface/hub/models--deinferno--LCM_Dreamshaper_v7-openvino/snapshots/62289fd6f0dcdde26d7e86cba0e50815611a5c6d/main' for available files.
from fastsdcpu.
same result
File "/Users/lucvaligny/fastsdcpu/src/frontend/gui/image_generator_worker.py", line 29, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/lucvaligny/fastsdcpu/src/frontend/gui/app_window.py", line 387, in generate_image
images = self.context.generate_text_to_image(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/lucvaligny/fastsdcpu/src/context.py", line 27, in generate_text_to_image
self.lcm_text_to_image.init(
File "/Users/lucvaligny/fastsdcpu/src/backend/lcm_text_to_image.py", line 56, in init
self.pipeline = OVLatentConsistencyModelPipeline.from_pretrained(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/lucvaligny/fastsdcpu/env/lib/python3.11/site-packages/optimum/modeling_base.py", line 372, in from_pretrained
return from_pretrained_method(
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/lucvaligny/fastsdcpu/env/lib/python3.11/site-packages/optimum/intel/openvino/modeling_diffusion.py", line 252, in _from_pretrained
kwargs[name] = load_method(new_model_save_dir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/lucvaligny/fastsdcpu/env/lib/python3.11/site-packages/transformers/image_processing_utils.py", line 202, in from_pretrained
image_processor_dict, kwargs = cls.get_image_processor_dict(pretrained_model_name_or_path, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/lucvaligny/fastsdcpu/env/lib/python3.11/site-packages/transformers/image_processing_utils.py", line 329, in get_image_processor_dict
resolved_image_processor_file = cached_file(
^^^^^^^^^^^^
File "/Users/lucvaligny/fastsdcpu/env/lib/python3.11/site-packages/transformers/utils/hub.py", line 400, in cached_file
raise EnvironmentError(
OSError: /Users/lucvaligny/.cache/huggingface/hub/models--deinferno--LCM_Dreamshaper_v7-openvino/snapshots/62289fd6f0dcdde26d7e86cba0e50815611a5c6d does not appear to have a file named preprocessor_config.json. Checkout 'https://huggingface.co//Users/lucvaligny/.cache/huggingface/hub/models--deinferno--LCM_Dreamshaper_v7-openvino/snapshots/62289fd6f0dcdde26d7e86cba0e50815611a5c6d/main' for available files.
from fastsdcpu.
@Vargol Nice insights, I don't have a Mac machine to test these things.
from fastsdcpu.
@YousufSSyed,@Vargol Yes, I have created a test branch for Mac support.
Could you please try this?
git clone https://github.com/rupeshs/fastsdcpu/
cd fastsdcpu
git checkout add-mac-cpu-support
chmod +x install-mac.sh
./install-mac.sh
To start : ./start.sh
Feel free to share your findings
from fastsdcpu.
@Autantpourmoi Thank you for tests,so the above commands worked right? I think you checked desktop GUI? how much time it takes to generate a single 512x 512 image 4 steps?
from fastsdcpu.
@Autantpourmoi Could you please share one screenshot of FastSD CPU running on Mac. I will add it in the readme.
from fastsdcpu.
@rupeshs is that ok ?
from fastsdcpu.
@Autantpourmoi yes, thank you so much for the Mac test support
from fastsdcpu.
@Autantpourmoi can you retry OpenVINO?
@deinferno
from fastsdcpu.
should i reinstall first or git clone ?
the 2 small arrow on the side of the image aren't working
from fastsdcpu.
@Autantpourmoi No,simply check use_openvino setting and generate
from fastsdcpu.
Ok it seems like OpenVINO is hard on Mac
from fastsdcpu.
what is it for ?
from fastsdcpu.
OpenVINO increases image generation speed by 2x it is only for CPU.
Uncheck the use_openvino setting.
@Autantpourmoi Could you please run this command
export DEVICE=mps
start using start.sh
, it will access the GPUuncheck openvino setting
Could you please run this command
export DEVICE=mps
start using start.sh
, it will access the GPU
Are you seeing any speed improvement?
from fastsdcpu.
are you also dev for comfy ui this lcm ?
from fastsdcpu.
No, I created FastSD CPU
I have other tools like DiffusionMagic https://github.com/rupeshs/diffusionmagic and neuralstyler.com
from fastsdcpu.
So speed increased now it is using GPU on the Mac
from fastsdcpu.
i should keep it like that , will try generate 10 images with this settings/ lol don't have time to clik 10 times that first images already there 512x512 / 25 steps / 6.52 sec
from fastsdcpu.
My testing is over.
from fastsdcpu.
@Autantpourmoi Thanks for your great support.
from fastsdcpu.
@rupeshs no pb
from fastsdcpu.
@Autantpourmoi how much system RAM do you have?
from fastsdcpu.
64Go
from fastsdcpu.
@YousufSSyed Add mac support in the release 1.0.0 beta 8 https://github.com/rupeshs/fastsdcpu/releases/tag/v1.0.0-beta.8
from fastsdcpu.
Related Issues (20)
- Realtime code doesn't load up all 128 threads in my AMD EPYC via OPENVINO HOT 2
- Feature Request: Quantized openvino models HOT 1
- Deprecated Parse HOT 2
- Higher resolutions? HOT 1
- Plans on Android HOT 4
- [Web ui] Switching models to openvino, if guidance is left at non 1, program breaks, memory leaks. HOT 1
- WebUI start error: AttributeError: 'AppSettings' object has no attribute '_config' HOT 2
- [Error]Fail to run HOT 7
- Problems Starting the Linux start script HOT 1
- More models and functions HOT 4
- Use openvino intel cpu plugin HOT 1
- High ram usage causes segmentation fault HOT 1
- Any plans to add an API? HOT 1
- How can I change the maximum memory size that can be used by this model? HOT 2
- How to use Dreamshaper xl turbo with fastsdcpu ? HOT 3
- installation on windows HOT 2
- fastsdcpu-1.0.0-beta.22 -install.bat fails HOT 4
- CivitAI checkpoints? HOT 2
- HIP / ROCm support planned? HOT 1
- [Feature Request]: OpenVino Converter
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastsdcpu.