DEV Community

Cover image for 🧠🤖Image generative AI on PC without GPU (free and fast (FastSD CPU))
Web Developer Hyper
Web Developer Hyper

Posted on

🧠🤖Image generative AI on PC without GPU (free and fast (FastSD CPU))

Intro

Usually, I am making images by ChatGPT.
But, I am using the free plan, so I can make only 3 images at once.
I want to make images unlimited for free and fast.
How can I make this dream come true?🤔
I Googled carefully and found that FastSD CPU might be the answer.

What is FastSD CPU

FastSD CPU is a faster version of Stable Diffusion on CPU.
https://github.com/rupeshs/fastsdcpu
Normally, without GPU it is soooo slow generating images locally.🐢
However, Based on Latent Consistency Models and Adversarial Diffusion Distillation, FastSD CPU can generate images faster than the normal models.
Also, it has OpenVINO support to generate images even faster locally.💨

How to use FastSD CPU

1️⃣ Install Python 3.10 or 3.11.
2️⃣ Clone or download the repo.
https://github.com/rupeshs/fastsdcpu
3️⃣ Run start.bat (GUI) or start-webui.bat (Web UI).
4️⃣ You are ready for FastSD CPU!🚀

Output of FastSD CPU

First, I inputted ”people” and pressed the generate button.
Hooray! I succeeded making a horror image.🤣
Image description

Next, I inputted ”dog” and pressed the generate button.
Ta-da! I succeeded making a nightmare image.🤣
Image description

How to improve the images

When using GUI, you can set the FastSD CPU at setting tab.
When I selected LCM-dreamshaper-v7-openvino for the model, and increased Number of inference steps from 1 to 4, images got quite better.
Image description
Steps is a number of reducing the times of noise.
When selecting FLUX.1-schnell-openvino-int4 for the model, quality became even better, but generating time got longer.
Image description

Generation time and PC Spec

I was using a normal office PC (CPU: Core i7, Memory: 16GB) and doesn't have a NVIDIA GPU.
It took about 20 seconds using LCM-dreamshaper-v7-openvino for 4 steps.
And, it took about 10 minutes using FLUX.1-schnell-openvino-int4 for 4 steps.
When using these models for the first time, it takes more time, because we need to download and compile the model.

Outro

Using FastSD CPU, we can generate images for free and fast even on a PC with no GPU.
I will write another post, if I know further about image generative AI.
Thank you for reading.
Happy AI image generating !🎨

Top comments (0)