Closed tomj2ee closed 11 months ago
Why hasn't this branch been merged into the main branch yet? It has essential functionalities.
Thanks for adding ReActor, I think it performs better than roop for faceswaping.
Thank you for the PR.
By the way, I detected a bug:
Currently there is this in ADetailer: ad_controlnet_module: Optional[str] = None,
it needs to be replaced to: ad_controlnet_module: str = "None",
otherwise it will crash.
I can create a new pull request
I created a new pull request https://github.com/mix1009/sdwebuiapi/pull/139
============test========= api = webuiapi.WebUIApi(host="127.0.0.1", port=7860, steps=30 )
ADetailer extends
ads = webuiapi.ADetailer(ad_model="face_yolov8n.pt")
prompt = "masterpiece, best quality, wall paper, (8k, best quality, masterpiece:1.2),a woman,garden," \ "Sexy, mature woman, wedding dress, smile,happy,flower,look at viewer, full body,"
nsfw = "nsfw,(nipples),leakage points, big boobs, leather, net lining, mesh lining, paintings, big head, sketches, naked, (worst quality:2), (low quality:2), (normal quality:2), lowres, bad anatomy, bad hands, normal quality, ((monochrome)), ((grayscale)), futanari, full-package_futanari, penis_from_girl, newhalf, nipplepierces, glans penis, collapsed eyeshadow, multiple eyeblows, vaginas in breasts, pink hair, holes on breasts, ng_deepnegative_v1_75t, skin spots, acnes, skin blemishes, age spot, glans, nsfw, nipples,extra fingers, ((extra arms)), (extra legs), mutated hands,(fused fingers), (too many fingers), (long neck:1.3)"
img=Image.open("./b.jpg") img2=Image.open("./e.jpg")
net=webuiapi.ControlNetUnit(input_image=img2, model="control_v11p_sd15_canny [d14c016b]", module="canny", )
model your local onnx path to input
roop=webuiapi.Roop(img=img,model="/opt/ai/stable-diffusion-webui/models/roop/inswapper_128.onnx") fs = api.txt2img( prompt=prompt, negative_prompt=nsfw, width=512, height=768, batch_size=2, adetailer=[ads], timeout=3000,
roop=roop,
) imgs = fs.images idx = 0 base_path="./imgs/" day = time.strftime("%Y%m%d") os.makedirs(base_path + day, exist_ok=True) for img in imgs: x=random.Random().randint(1,100000) t=time.strftime("/%H%M%S") img.save(base_path + day +t+ str(x)+ ".png") idx = idx + 1