-
Notifications
You must be signed in to change notification settings - Fork 16
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
"RuntimeError: Found at least two devices" #10
Comments
Does it give a stacktrace of this error? |
not sure where to find this information |
Stack trace looks like this in python. I found a similar error with Fooocus on Reddit. What were you trying to do when this error was returned?
|
I think the difference would be that one is using the virtual environment |
actually I just got the error running from cmd so I take that back lol. I think it's more of a time between starting a fresh execution and it idling. |
Yeah I have A1 for 1.5 but not running it atm. |
What operation within Fooocus causes the error from the OP? |
seems like it's all the functions that generate an image. |
After activating the venv with |
|
Can you post the full output from when the error occurs? Also, does it ever happen when starting, or only during image generation? I see a similar issue on the main repo here. |
Errors seem to fluctuate, this is running inswapper on 0.
|
This is a different error. It says
from the same directory where |
just to be consistent, how many files are copying for you when you run these? basicsr = 50 files copied |
|
It looks like you are running it outside of the venv. If you activate the venv and run what error do you get? |
|
Something I noticed is that it is using CPUExecutionProvider during the inswapper routine. What video card do you have? |
Gigabyte 4070 |
With the venv activated, can you run a plain
|
|
I want to force it to use the GPU. For some reason it seems Fooocus can't use or see the GPU. Can you try the https://github.com/lllyasviel/Fooocus?tab=readme-ov-file#all-cmd-flags
|
running it now. Noticing the first generation is running super slow 7s per it. I feel like Fooocus sees the gpu but the secondary script doesn't maybe? because the first generation is usually fast and working then it switches to a different module? |
If you check your task manager resources tab, can you see GPU memory being allocated, and GPU processor being used during the generation? |
|
It's deff hitting the GPU |
Be sure to activate the venv. The previous log shows venv is not activated. |
If you are using PhotoMaker, it requires at least 16GB VRAM, otherwise it will offload to system memory and generation time will be slow. That is a PhotoMaker requirement, nothing I can fix right now. |
this is Inswapper |
I misspoke anyhow. PhotoMaker's docs say 11GB is required. I must have been thinking of InstantID which will be integrated soon. When running inswapper, do you notice "CPUExecutionProvider" in the log? If so then that is probably why. Let me check the code to make sure it isn't defaulting to CPU for some reason. I am expecting to see "CUDAExecutionProvider". |
@machineminded What actually is the difference between Inswapper and PhotoMaker? |
I do notice on my local that inswapper is also using CPUExecutionProvider. I believe I know the root cause, and will test soon. Inswapper uses insightface to swap faces from a source image to a target image. Meaning, it will overlay a face onto an existing image. PhotoMaker and InstantID will both use input images to guide the latent space towards a result. They also use huggingface diffusers, whereas the default Fooocus pipelines use ksampler. If you want to disable PhotoMaker, I would uncheck "Enabled" to unload it from VRAM. |
It doesn't seem to be an issue as long as I don't check it in the first place. But yeah I do notice some pixilation around faces when using Inswapper, so that wouldn't happen on PhotoMaker then I suppose? |
Inswapper and PhotoMaker are two separate ways to re-create someone's identity. Since PhotoMaker isn't overlaying an image you wouldn't see the pixelation, but the likeness may not be perfect either. |
Gotcha, it's still pretty damn impressive though considering you're not actually training a whole model. |
You should be able to resolve the inswapper CPU issue by installing
|
Does this version have Clip Skip? I noticed some models require it |
|
I should be integrating InstantID soon, which is even more impressive.
PhotoMaker and InstantID would support clip skip, but Fooocus doesn't provide anywhere to set and pass this value. Even the base Fooocus doesn't allow a way to set clip skip.
If the app is running, maybe try stopping the app and run the command again. |
Ok that worked |
is there clip skip btw? |
So everything seems to be working fine as far as I can tell. The only issue is that I get the "2 devices" error if I'm not in a fresh instance and try to use PhotoMaker. Otherwise it seems like if I use PhotoMaker first it does work. But since this doesn't really get the results I like anyways (and it's resource intensive) I probably won't use it much anyways. There hasn't been any issues with Inswapper. I checked out the Inswapper repo and I noticed that it's mainly advertised as a "faceswapper" but I've been using it exclusively as a reference to generate photos of people I know (1 person only at a time though). Is that what your goal was for the plugin? And I noticed there were extra configurations in the description. Are these available to use in your version of Fooocus already?
|
They're not yet available. Right now you can only control the target index face where it is applied. Those will be added eventually but working on the InstantID integration now. Re: clip skip, even base Fooocus doesn't support changing this value. |
Right now, these are the values being passed. Face restoration is always enabled right now.
The upsampler used is always Real ESRGAN. |
Is there any way instead of using the AI generated image for the swap you can input your own picture? It seems like that's how the vanilla version of Inswapper works but not sure how/if it's implemented in this Fooocus version. |
That is on my todo list in the readme.md. I am focusing on other things for now but it is identified as an upcoming feature. |
@tailgunnerx I created this feature request |
My guess is that PhotoMaker is off loading resources to two places which is why you get that error. I'll have to work on optimizing it for 12GB cards I think. |
PhotoMaker itself requires 11GB, and with the other stuff that Fooocus loads it may not be possible at the moment. |
Because it's so slow for me it's hard to really tell if it's useful (can't generate fast enough for trial and error). If you were to use it are you able to get consistent good results for things like putting in faces of people you know (and actually have it look like them)? |
Hmm, I'd say it's close. Totally an opinion, but I think InstantID is much better. I use PhotoMaker with inswapper and it looks okay sometimes. You can experiment with just PhotoMaker here on huggingface: https://huggingface.co/spaces/TencentARC/PhotoMaker The results you see out here would be the same you see in my version of Fooocus. |
Yeah so even on that I can't get any good results, which slider makes it stronger resemblance? Maybe it's just my subjects photos too... not good enough possibly. |
I have had mixed results with PhotoMaker. Lots of images and angles definitely helps. |
Is there a DreamBooth integration coming soon too? 😁 |
Dreambooth is a training method, not an inference method. You would train a model using the Dreambooth method then load the model and create images with it. |
1 similar comment
Dreambooth is a training method, not an inference method. You would train a model using the Dreambooth method then load the model and create images with it. |
Yeah I know, which works pretty well in 1.5 if you want to make photos of someone. Would be cool if there was like a "lite" version of Dreambooth integration where all the difficult configs are setup already, just need to input the photos. Then generate a LORA or model... |
When using PhotoMaker for the first time:
Per ChatGPT4:
The text was updated successfully, but these errors were encountered: