machineminded / Fooocus-inswapper

Focus on prompting and generating with an inswapper integration
GNU General Public License v3.0
75 stars 15 forks source link

instantid-integration problem(s) #15

Closed barepixels closed 7 months ago

barepixels commented 7 months ago

had trouble installing at first from this link https://github.com/machineminded/Fooocus-inswapper/tree/feature/instantid-integration because instruction say to git clone git clone https://github.com/machineminded/Fooocus-inswapper.git which I install a version without instantid tab got it working never the less

so i create a new folder name "Fooocus-inswapper-feature-instantid-integration" this time instead of git clone, I zip the files and download with this new instalation I see instantid tab

tab 1 inswappers works. athought I gets errors in CMD window in red color text:

2024-02-15 15:56:28.5015420 [E:onnxruntime:Default, provider_bridge_ort.cc:1532 onnxruntime::TryGetProviderInfo_TensorRT] D:\a\_work\1\s\onnxruntime\core\session\provider_bridge_ort.cc:1209 onnxruntime::ProviderLibrary::Get [ONNXRuntimeError] : 1 : FAIL : LoadLibrary failed with error 126 "" when trying to load "E:\Fooocus-inswapper-feature-instantid-integration\venv\lib\site-packages\onnxruntime\capi\onnxruntime_providers_tensorrt.dll"

inswappers did works. Prompt "painting of a beautiful woman with long hair" and chose "Artstyle Waterolor" results sort of look like her and is in watercolor style

moving on to tab 2 photomaker add "img, " to the begining of previous prompt. "img, painting of a beautiful woman with long hair" and choose "Artstyle Waterolor" results worked, they look like a painting BUT not a watercolor, more like oil paint. So photomaker did not used "Artstyle Waterolor"

while at photomaker I tried uploading 4 images of the same girl. It works similar to uploading just 1 image

move on to tab 3 instantid remove "img, " from prompt, choose "Artstyle Waterolor" upload 1 image got ERROR

InstantID: Begin
InstantID: Positive prompt: watercolor painting painting of a beautiful woman with long hair . vibrant, beautiful, painterly, detailed, textural, artistic
InstantID: Negative prompt: anime, photorealistic, 35mm film, deformed, glitch, low contrast, noisy
InstantID: Loading diffusers pipeline into memory.
Traceback (most recent call last):
  File "E:\Fooocus-inswapper-feature-instantid-integration\modules\async_worker.py", line 885, in worker
    handler(task)
  File "E:\Fooocus-inswapper-feature-instantid-integration\venv\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "E:\Fooocus-inswapper-feature-instantid-integration\venv\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "E:\Fooocus-inswapper-feature-instantid-integration\modules\async_worker.py", line 810, in handler
    imgs = generate_instantid(instantid_image_path, instantid_pose_image_path, instantid_prompt, instantid_negative_prompt, steps, task['task_seed'], width, height, guidance_scale, loras, sampler_name, scheduler_name, async_task, instantid_identitynet_strength_ratio, instantid_adapter_strength_ratio)
  File "E:\Fooocus-inswapper-feature-instantid-integration\modules\instantid.py", line 144, in generate_instantid
    pipe = load_model(loras, sampler_name)
  File "E:\Fooocus-inswapper-feature-instantid-integration\modules\instantid.py", line 50, in load_model
    app = FaceAnalysis(name='antelopev2', root='InstantID', providers=['CUDAExecutionProvider', 'CPUExecutionProvider'])
  File "E:\Fooocus-inswapper-feature-instantid-integration\venv\lib\site-packages\insightface\app\face_analysis.py", line 43, in __init__
    assert 'detection' in self.models
AssertionError
Total time: 0.98 seconds
machineminded commented 7 months ago

I'll run the install from scratch and see what's going on - thank you

machineminded commented 7 months ago

The issue with PhotoMaker is probably more on the PhotoMaker side of things... it might also work better with less styles selected on the styles tab. I'll mess with it a bit.

machineminded commented 7 months ago

There is an issue installing the antelope models. I'll get a fix pushed up shortly.

barepixels commented 7 months ago

E:\Fooocus-inswapper-feature-instantid-integration\InstantID\models\antelopev2.zip CORRUPT E:\Fooocus-inswapper-feature-instantid-integration\InstantID\models\antelopev2\antelopev2.zip CORRUPT

AND

While trying photomaker, I only had 1 "Artstyle Waterolor" selected

machineminded commented 7 months ago

I have updated the configure.bat. Can you run these three commands from your Fooocus-inswapper directory?

powershell -Command "& { Invoke-WebRequest -Uri 'https://keeper.mpdl.mpg.de/f/2d58b7fed5a74cb5be83/?dl=1' -OutFile '.\InstantID\models\antelopev2.zip' }"
powershell -Command "Expand-Archive .\InstantID\models\antelopev2.zip .\InstantID\models\antelopev2"
powershell -Command "Remove-Item .\InstantID\models\antelopev2.zip"
barepixels commented 7 months ago

all three command works 5 files extracted to E:\Fooocus-inswapper-feature-instantid-integration\InstantID\models\antelopev2

machineminded commented 7 months ago

Cool, can you try to use instantID again and let me know if you run into an issue?

machineminded commented 7 months ago

I'm not sure how to resolve the red text warning - I don't think it's a big issue but will research. I have it on my machine as well.

barepixels commented 7 months ago

on it launching. BTW I create a "run.bat" at root of my E:\Fooocus-inswapper-feature-instantid-integration\

it's content: .\venv\Scripts\python.exe -s .\launch.py pause make it easier to use

barepixels commented 7 months ago

it works, sort of... it didn't use style just like photomaker 001 002

machineminded commented 7 months ago

Let me try some things on my end real quick to see what might be going on

barepixels commented 7 months ago

inswapper DID use style

003

barepixels commented 7 months ago

instantID with Charcoal Lora no style . so happy

004

machineminded commented 7 months ago

I was able to get a decent one with the following:

positive prompt painting of a beautiful woman with long hair

negative prompt (lowres, low quality, worst quality:1.2), (text:1.2), watermark, (frame:1.2), deformed, ugly, deformed eyes, blur, out of focus, blurry, deformed cat, deformed, photo, anthropomorphic cat, monochrome, pet collar, gun, weapon, blue, 3d, drones, drone, buildings in background, green

selected style Artstyle Watercolor

scheduler Euler

image

I still don't always get a watercolor style. Maybe it has to do with the base model I am using (Juggernaut XL 8)

barepixels commented 7 months ago

that watercolor is not the same style as "Artstyle Watercolor" selection

with inswaper "Artstyle Watercolor" is consistant

its ok am happy with using lora dont kill yourself over it. no rush

machineminded commented 7 months ago

Sounds good, will continue to mess with it. Could be different things at play... thanks for checking out my repo!

barepixels commented 7 months ago

yeah for now your repo is my new default foooocus to go to. I have one wish lol

merge mashb1t's add metatag to image

please please please

machineminded commented 7 months ago

I can probably do that. I will check out their repo and plan for the work:

https://github.com/machineminded/Fooocus-inswapper/issues/17

machineminded commented 7 months ago

I noticed that using the YamerMIX v8 I can get better watercolor results:

image

I believe that Fooocus and InstantID are working as designed. I will close this issue. Thanks for working with me on this!

barepixels commented 7 months ago

thank you sir