mix1009 / sdwebuiapi

Python API client for AUTOMATIC1111/stable-diffusion-webui
MIT License
1.35k stars 182 forks source link

Update webuiapi.py #109

Closed tomj2ee closed 1 year ago

tomj2ee commented 1 year ago

添加ADetailer 插件api支持

ADetailer api

tomj2ee commented 1 year ago

ADetailer api

tomj2ee commented 1 year ago

==========test ==========

import time

import webuiapi

api = webuiapi.WebUIApi(host="xxx.com", port=80, steps=30, ) img = None ads = webuiapi.ADetailer(ad_model="face_yolov8n.pt")

prompt = "masterpiece, best quality, wall paper, (8k, best quality, masterpiece:1.2),a woman , " nsfw = "nsfw,(nipples),leakage points,(((sexy))), 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)"

fs = api.txt2img( prompt=prompt, negative_prompt=nsfw, width=512, height=768, batch_size=8, adetailer=[ads] ) imgs = fs.images idx = 0 for img in imgs: s = time.strftime("%Y%m%d%H%M%S") img.save("./imgs/" + s + str(idx) + ".png") idx = idx + 1