Open rookiexjl opened 1 year ago
The instructions for using the API via Python can be found at the link below:
https://github.com/Uminosachi/sd-webui-inpaint-anything/blob/main/README_DEV.md
Will similar API fastapis be added in the future?
------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2023年9月18日(星期一) 下午5:04 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [Uminosachi/sd-webui-inpaint-anything] how is use api? (Issue #95)
The instructions for using the API via Python can be found at the link below:
https://github.com/Uminosachi/sd-webui-inpaint-anything/blob/main/README_DEV.md
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
At this time, there are no plans in place to develop a web API.
Segments Image Create Mask use many point?
python README_DEV.md
import importlib
import numpy as np from PIL import Image, ImageDraw
inpalib = importlib.import_module("extensions.sd-webui-inpaint-anything.inpalib") available_sam_ids = inpalib.get_available_sam_ids()
use_sam_id = "C:\D\code\stable-diffusion-webui\extensions\sd-webui-inpaint-anything\models\sam_vit_l_0b3195.pth"
input_image = np.array(Image.open("C:\D\code\stable-diffusion-webui\extensions\sd-webui-inpaint-anything\images\isample_input_image.png"))
sam_masks = inpalib.generate_sam_masks(input_image, use_sam_id, anime_style_chk=False) sam_masks = inpalib.sort_masks_by_area(sam_masks)
seg_color_image = inpalib.create_seg_color_image(input_image, sam_masks)
Image.fromarray(seg_color_image).save("C:\D\code\stable-diffusion-webui\extensions\sd-webui-inpaint-anything\images\seg_color_image.png")
sketch_image = Image.fromarray(np.zeros_like(input_image))
draw = ImageDraw.Draw(sketch_image) draw.point((input_image.shape[1] // 2, input_image.shape[0] // 2), fill=(255, 255, 255))
mask_image = inpalib.create_mask_image(np.array(sketch_image), sam_masks, ignore_black_chk=True)
Image.fromarray(mask_image).save("C:\D\code\stable-diffusion-webui\extensions\sd-webui-inpaint-anything\images\mask_image.png")
无法定位程序箱入点 ?assertSignaturelsCorrect@ OperatorEntry@impl@c10@@QEBAXVCppSi gnature@23@ N@Z 于动态链接库 C: Users xiaoyulanaconda3 envs'stable diffusion python10 Lib'site-packages\torchvision), C.pyd 上
The inpalib
in the web UI extension version requires webui.bat
to be running to function properly. In contrast, the standalone version of inpalib
is more user-friendly.
The README_DEV of the Standalone version: https://github.com/Uminosachi/inpaint-anything/blob/main/README_DEV.md
https://github.com/Uminosachi/sd-webui-inpaint-anything/blob/main/ia_file_manager.py
Excuse me, where did the modules in the fifth line of this file (from modules import shared) come from ?
Excuse me, where did the modules in the fifth line of this file (from modules import shared) come from ?
That import is loading the shared.py
file in the stable-diffusion-webui/modules
directory.
Excuse me,I copy the code in https://github.com/Uminosachi/sd-webui-inpaint-anything/blob/main/README_DEV.md,but it did not work.
什么事
how is use api?