Skip to content

Use CPU if no CUDA device is detected#132

Open
philippschw wants to merge 2 commits intoCompVis:mainfrom
philippschw:cpu-inference
Open

Use CPU if no CUDA device is detected#132
philippschw wants to merge 2 commits intoCompVis:mainfrom
philippschw:cpu-inference

Conversation

@philippschw
Copy link
Copy Markdown

No description provided.

@JustinGuese
Copy link
Copy Markdown

@philippschw how did the duration for the run change? i feel like it would take way longer, if it works at all?

@philippschw
Copy link
Copy Markdown
Author

philippschw commented Aug 31, 2022

@JustinGuese, it works but you are also right, it takes over an hour to make a single inference call on my MacBook Pro. 2.9 GHz 6-Core Intel i9 and 16GB RAM.

@illeatmyhat
Copy link
Copy Markdown

That can't be right. I have an i7-1260p with 8 actual cores. A 512x512 image with 50 steps will inference in 12 minutes on my branch.
The OpenVINO model does the same in 7 minutes.

@JustinGuese
Copy link
Copy Markdown

yeah anyways, cpu time is way too long

out of curiosity: if I would provide a "hosted" stable-diffusion, would you actually pay for it? or rather use the CPU for cost reasons? like the server would cost me ~600€/month, so I would need a lot of interest/people to be worth it

@shi-yan
Copy link
Copy Markdown

shi-yan commented Sep 7, 2022

conda env create -f environment.yaml

fails on mac, not sure if this PR should include an alternative environment.yaml?

@shi-yan
Copy link
Copy Markdown

shi-yan commented Sep 7, 2022

conda env create -f environment.yaml

on mac, not sure if this PR should include an alternative environment.yaml?

sorry, didn't realize there is environment-cpu.yaml

@jpdeleon
Copy link
Copy Markdown

jpdeleon commented Sep 8, 2022

There is a bug: undefined variable wm_encoder in scripts/txt2img.py, because imwatermark was intentionally removed.

@philippschw
Copy link
Copy Markdown
Author

There is a bug: undefined variable wm_encoder in scripts/txt2img.py, because imwatermark was intentionally removed.

Thanks @jpdeleon, I updated the code.

Comment thread scripts/img2img.py

parser.add_argument(
"--init-img",
"--init_img",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a non-additive interface change. I'd recommend against as it impacts anyone writing scripts to interact with the original code. It's also beyond the intent of the commit.

Copy link
Copy Markdown

@EonDigital EonDigital Sep 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is your .gitmodules file?

@alperinugur
Copy link
Copy Markdown

That can't be right. I have an i7-1260p with 8 actual cores. A 512x512 image with 50 steps will inference in 12 minutes on my branch. The OpenVINO model does the same in 7 minutes.

similar for me here

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.

7 participants