-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Support API #21
Comments
I'm focusing on UI-based image processing and not considering an external API now. |
I may be able to try adding the API section |
The API here is worth calling through the SDK webui API |
The process of Inpaint Anything involves several steps, including segmentation, pointing by sketch, and mask generation. If even one of these steps is missing, the whole process won't function. I'm concerned about how to implement these steps as APIs. |
I think it's possible to break down each step into a separate API
... |
I've moved the SAM execution and mask generation code to separate library files, making it easier for other applications to utilize them. https://github.com/Uminosachi/inpaint-anything/blob/main/README_DEV.md |
thanks for your complete this! |
Will DINO be supported? If possible, I will be willing to contribute API related code |
I'm not considering using DINO at the moment. |
Thank you so much for everything you've done. By the way, I have a couple of questions:
|
The inpainting feature in this app uses the https://huggingface.co/docs/diffusers/api/pipelines/stable_diffusion/inpaint
In the sample code, you can set the coordinates at the line provided below. By modifying https://github.com/Uminosachi/inpaint-anything/blob/main/README_DEV.md draw.point((input_image.shape[1] // 2, input_image.shape[0] // 2), fill=(255, 255, 255)) |
Thanks for your reply~ |
Lama Cleaner can be installed as an individual package using pip, similar to diffusers. pip install lama-cleaner While I haven't created sample code, you might be able to code by referring to the import cv2
import numpy as np
import torch
from lama_cleaner.model_manager import ModelManager
from lama_cleaner.schema import Config, HDStrategy, LDMSampler, SDSampler
from PIL import Image
device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
model = ModelManager(name="lama", device=device)
init_image = np.array(init_image)
mask_image = np.array(mask_image.convert("L"))
config = Config(
ldm_steps=20,
ldm_sampler=LDMSampler.ddim,
hd_strategy=HDStrategy.ORIGINAL,
hd_strategy_crop_margin=32,
hd_strategy_crop_trigger_size=512,
hd_strategy_resize_limit=512,
prompt="",
sd_steps=20,
sd_sampler=SDSampler.ddim
)
output_image = model(image=init_image, mask=mask_image, config=config)
output_image = cv2.cvtColor(output_image.astype(np.uint8), cv2.COLOR_BGR2RGB)
output_image = Image.fromarray(output_image) |
import importlib import numpy as np inpalib = importlib.import_module("inpaint-anything.inpalib") ModuleNotFoundError: No module named 'inpaint-anything' Hi, i have try the code, but where can i find the "inpaint-anything.inpalib"? |
Before you proceed, please make sure you've cloned this repository to your current directory using the following command: git clone https://github.com/Uminosachi/inpaint-anything.git |
I have build API around this, I am returning segmented image, mask based on selected points , and merged image of segments and original, |
change "inpaint-anything.inpalib" to "inpalib" |
Can inpaint-anything support API
The text was updated successfully, but these errors were encountered: