Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpu support for txt2img and img2img #605

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Ricardicus
Copy link

Hello,

I made this PR because this fix makes it possible to run txt2img and img2img on the CPU.
It takes some time using the CPU, for sure, but it works.
In the code, it is sometimes assumed that cuda is available and other times it isn't assumed.
Since it isn't consistent, I figured this change might be interesting for you upstream.

Thanks!

@Freedomlee1
Copy link

ring

@chrisjohnson00
Copy link

Is there a way to force using the CPU even if the GPU is available?
I've a few memory consumption changes I've made, but have been looking for a way to run img2img, but my memory changes don't work there.

@Ricardicus
Copy link
Author

Ricardicus commented Jul 21, 2023

Is there a way to force using the CPU even if the GPU is available?
I've a few memory consumption changes I've made, but have been looking for a way to run img2img, but my memory changes don't work there.

Check the code, it has to do with a string specifying the device. If it is set to "cuda" that means it is using the gpu. One can fork, then set it to "cpu" everywhere regardless. There is no command line argument available that forces setting it to cpu unfortunately. But with this fork of mine, one can run it on cpu if there is no gpu available. Fork my fork, then write "cpu" everywhere then you are good :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants