Bing-su / adetailer

Auto detecting, masking and inpainting with detection model.
GNU Affero General Public License v3.0
4.04k stars 316 forks source link

[Feature Request]: How to use code with prompt instead of ComfyUI and SDA1111 #659

Closed khawar-islam closed 2 weeks ago

khawar-islam commented 1 month ago

Is your feature request related to a problem? Please describe.

I want to use the codebase where i can provide the picture and it fix the hand and face issue. I have implemented huggingface code but it detects the hand and face but do not fix this problem.

from huggingface_hub import hf_hub_download
from ultralytics import YOLO

path = hf_hub_download("Bingsu/adetailer", "hand_yolov9c.pt")
model = YOLO(path)

import cv2
from PIL import Image

img = "/home/cvpr/Downloads/imgtesting.webp"
output = model(img)
pred = output[0].plot()
pred = cv2.cvtColor(pred, cv2.COLOR_BGR2RGB)
pred = Image.fromarray(pred)
pred.save("ddd.jpg")

Describe the solution you'd like

I need a code without comfyUI and SDAutomatic1111 where i can fix the hand and face.

Describe alternatives you've considered

No

Additional context

No response

Bing-su commented 1 month ago

It only has the ability to detect specific parts of an image. Then, it calls the inpainting API via SDWebUI.

So you can't do inpainting without a backend.

khawar-islam commented 1 month ago

I am also trying to fix the hand but still there are problems with finger, could you please check this thread?

https://www.reddit.com/r/StableDiffusion/comments/1e19gbn/comment/lcsqg76/?context=3

Bing-su commented 1 month ago

It's hard to fix hands with just inpainting. Try ControlNet's hand refiner.