GithubHelp home page GithubHelp logo

Comments (11)

kalle07 avatar kalle07 commented on June 11, 2024 1

newest faceswap

Automatic1111 (1.8.0)
tab img2img -> tab inpaint
with or without mask

error:
2024-03-23 14:40:19,818 - FaceSwapLab - INFO - Try to use model : D:\stable-diffusion\webui\models\faceswaplab\inswapper_128.onnx████████████████████████████████████████████████████████████████████████████████| 31/31 [00:10<00:00, 2.96it/s]
d:\stable-diffusion\system\python\lib\site-packages\insightface\utils\transform.py:68: FutureWarning: rcond parameter will change to the default of machine precision times max(M, N) where M and N are the input matrix dimensions.
To use the future default and silence this warning we advise to pass rcond=None, to keep using the old, explicitly pass rcond=-1.
P = np.linalg.lstsq(X_homo, Y)[0].T # Affine matrix. 3 x 4
2024-03-23 14:40:21,199 - FaceSwapLab - INFO - Finished processing image, return 1 images
2024-03-23 14:40:21,199 - FaceSwapLab - INFO - 1 images swapped
2024-03-23 14:40:21,207 - FaceSwapLab - INFO - Add swp image to processed
2024-03-23 14:40:21,207 - FaceSwapLab - ERROR - Failed to swap face in postprocess method : 'tuple' object has no attribute 'height'
Traceback (most recent call last):
File "D:\stable-diffusion\webui\extensions\sd-webui-faceswaplab\scripts\faceswaplab.py", line 216, in postprocess
save_image(
File "D:\stable-diffusion\webui\modules\images.py", line 611, in save_image
if (image.height > 65535 or image.width > 65535) and extension.lower() in ("jpg", "jpeg") or (image.height > 16383 or image.width > 16383) and extension.lower() == "webp":
AttributeError: 'tuple' object has no attribute 'height'
Total progress: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 31/31 [00:12<00:00, 2.46it/s]
Total progress: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 31/31 [00:12<00:00, 2.96it/s]

btw:
in img2img it worked fine but i will change the face and dont calculate a whole image

from sd-webui-faceswaplab.

kalle07 avatar kalle07 commented on June 11, 2024 1

not work :(

...

    if p.overlay_images and batch_index < len(p.overlay_images):
        selected_overlay = p.overlay_images[batch_index]
        img = processing.apply_overlay(img, p.paste_to, selected_overlay)
    else:
        return img, original_denoised_image
        logger.debug("No overlay selected or overlay list is empty.")
    if p.color_corrections is not None and batch_index < len(p.color_corrections):
        img = processing.apply_color_correction(
            p.color_corrections[batch_index], img
        )
return img

...

img, _ = (also not working same error)
delete "original_denoised_image" also not working

Total progress: 100%|██████████████████████████████████████████████████████████████████| 31/31 [00:22<00:00, 1.38it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 31/31 [00:19<00:00, 1.58it/s]
2024-03-28 10:46:00,732 - FaceSwapLab - INFO - Try to use model : D:\stable-diffusion\webui\models\faceswaplab\inswapper_128.onnx
d:\stable-diffusion\system\python\lib\site-packages\insightface\utils\transform.py:68: FutureWarning: rcond parameter will change to the default of machine precision times max(M, N) where M and N are the input matrix dimensions.
To use the future default and silence this warning we advise to pass rcond=None, to keep using the old, explicitly pass rcond=-1.
P = np.linalg.lstsq(X_homo, Y)[0].T # Affine matrix. 3 x 4
2024-03-28 10:46:02,004 - FaceSwapLab - INFO - blend all faces together
2024-03-28 10:46:02,004 - FaceSwapLab - INFO - loading face Vero_face.safetensors
2024-03-28 10:46:02,004 - FaceSwapLab - INFO - Int Gender : 0
2024-03-28 10:46:02,004 - FaceSwapLab - INFO - Process face 0
2024-03-28 10:46:02,004 - FaceSwapLab - INFO - Source Gender 0
2024-03-28 10:46:02,004 - FaceSwapLab - INFO - Target faces count : 1
2024-03-28 10:46:02,004 - FaceSwapLab - INFO - swap face 0
2024-03-28 10:46:02,659 - FaceSwapLab - INFO - ********************************************************************************
2024-03-28 10:46:02,659 - FaceSwapLab - INFO - Inswapper
2024-03-28 10:46:02,667 - FaceSwapLab - INFO - ********************************************************************************
2024-03-28 10:46:02,770 - FaceSwapLab - INFO - Finished processing image, return 1 images
2024-03-28 10:46:02,778 - FaceSwapLab - INFO - 1 images swapped
2024-03-28 10:46:02,778 - FaceSwapLab - ERROR - Failed to swap face in postprocess method : apply_overlay() takes 3 positional arguments but 4 were given
Traceback (most recent call last):
File "D:\stable-diffusion\webui\extensions\sd-webui-faceswaplab\scripts\faceswaplab.py", line 201, in postprocess
swp_img = imgutils.apply_mask(swp_img, p, batch_index)
File "D:\stable-diffusion\webui\extensions\sd-webui-faceswaplab\scripts\faceswaplab_utils\imgutils.py", line 226, in apply_mask
img = processing.apply_color_correction(
TypeError: apply_overlay() takes 3 positional arguments but 4 were given
Total progress: 100%|██████████████████████████████████████████████████████████████████| 31/31 [00:22<00:00, 1.36it/s]
2024-03-28 10:49:14,600 - ControlNet - INFO - Preview Resolution = -1██████████████████| 31/31 [00:22<00:00, 1.59it/s]

which nvidia driver is working ? and why should this important ?

from sd-webui-faceswaplab.

jaesimio avatar jaesimio commented on June 11, 2024

@kalle07,
Plaese check this

from sd-webui-faceswaplab.

kalle07 avatar kalle07 commented on June 11, 2024

what iv made wrong ?

return img

    if p.overlay_images and batch_index < len(p.overlay_images):
      selected_overlay = p.overlay_images[batch_index]
      img, _ = processing.apply_overlay(img, p.paste_to, selected_overlay)
    else:
      return image, original_denoised_image
      logger.debug("No overlay selected or overlay list is empty.")

    if p.color_corrections is not None and batch_index < len(p.color_corrections):
        img = processing.apply_color_correction(
            p.color_corrections[batch_index], img
        )
return img

from sd-webui-faceswaplab.

BigZampano avatar BigZampano commented on June 11, 2024

Had this problem a few days ago, made the proposed changes to the imgutils.py and it worked again...
(@kalle07: the indentation of the lines is important, maybe re-check..)

Now today the same error came back...!
I checked the imgutils.py file and the changes I made are still there...

Yesterday I updated the Nvidia driver for my 3060, it's now at version 551.86... could that be the issue...?

The problem is only when inpainting, img2img works fine...


Edit: I downgraded the Nvidia driver and it's working again...!!

from sd-webui-faceswaplab.

jaesimio avatar jaesimio commented on June 11, 2024

@kalle07,

You need to check the indentation and apply_mask() function's return value.

    if p.overlay_images and batch_index < len(p.overlay_images):
        selected_overlay = p.overlay_images[batch_index]
        img, _ = processing.apply_overlay(img, p.paste_to, selected_overlay)
    else:
        return image, original_denoised_image
#               ^
#               I think this point is wrong
        logger.debug("No overlay selected or overlay list is empty.")

    if p.color_corrections is not None and batch_index < len(p.color_corrections):
        img = processing.apply_color_correction(
            p.color_corrections[batch_index], img
        )
return img

to:

        return img

from sd-webui-faceswaplab.

kalle07 avatar kalle07 commented on June 11, 2024

really it depends on nvidia driver (my is 546.17)

ok .. to be shure

thats my original

    if p.overlay_images and batch_index < len(p.overlay_images):
      selected_overlay = p.overlay_images[batch_index]
      img = processing.apply_overlay(img, p.paste_to, selected_overlay)
    else:
      return img
      logger.debug("No overlay selected or overlay list is empty.")

    if p.color_corrections is not None and batch_index < len(p.color_corrections):
        img = processing.apply_color_correction(
            p.color_corrections[batch_index], img
        )
return img

what exact i should change (i have v 1.8.0)

from sd-webui-faceswaplab.

jaesimio avatar jaesimio commented on June 11, 2024

@kalle07

Try this code and if that doesn't work, it's probably a nvidia driver issue.

    if p.overlay_images and batch_index < len(p.overlay_images):
      selected_overlay = p.overlay_images[batch_index]
      img, _ = processing.apply_overlay(img, p.paste_to, selected_overlay)
#     ^
#     change this only
    else:
      return img
#     ^
#     do not change
      logger.debug("No overlay selected or overlay list is empty.")

    if p.color_corrections is not None and batch_index < len(p.color_corrections):
        img = processing.apply_color_correction(
            p.color_corrections[batch_index], img
        )
return img

from sd-webui-faceswaplab.

kalle07 avatar kalle07 commented on June 11, 2024

hello , any idea ?

from sd-webui-faceswaplab.

LucianoDaluz avatar LucianoDaluz commented on June 11, 2024

2024-06-03 11:53:01,725 - FaceSwapLab - ERROR - Failed to swap face in postprocess method : apply_overlay() takes 3 positional arguments but 4 were given
Traceback (most recent call last):
File "C:\Users\lucia\Videos\SD\stable-diffusion-webui\extensions\sd-webui-faceswaplab\scripts\faceswaplab.py", line 201, in postprocess
swp_img = imgutils.apply_mask(swp_img, p, batch_index)
File "C:\Users\lucia\Videos\SD\stable-diffusion-webui\extensions\sd-webui-faceswaplab\scripts\faceswaplab_utils\imgutils.py", line 224, in apply_mask
img = processing.apply_overlay(img, p.paste_to, batch_index, p.overlay_images)
TypeError: apply_overlay() takes 3 positional arguments but 4 were given

from sd-webui-faceswaplab.

kalle07 avatar kalle07 commented on June 11, 2024

use
reactor

is in the extension list in a1111

if you mask a to small area.. this error apears !!!
you shoukld reduce
"Only masked padding, pixels" to 4 to 12

from sd-webui-faceswaplab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.