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

2

🧠🤖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 !🎨

API Trace View

How I Cut 22.3 Seconds Off an API Call with Sentry

Struggling with slow API calls? Dan Mindru walks through how he used Sentry's new Trace View feature to shave off 22.3 seconds from an API call.

Get a practical walkthrough of how to identify bottlenecks, split tasks into multiple parallel tasks, identify slow AI model calls, and more.

Read more →

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more