Stability-AI / rest-api-support

Stability REST API examples, issues, and discussions | https://api.stability.ai
107 stars 21 forks source link

inpainting problem #16

Open grzegorzewskiflyingdog opened 1 year ago

grzegorzewskiflyingdog commented 1 year ago

Ive tried to make inpainting using Stability-AI/REST-API operation: image-to-image/masking url : /v1betageneration/operation/imageToImage

I use param mask_source:INIT_IMAGE_ALPHA the example promt:man sitting, for this image, but i always get result with black border what is wrong here ? 11111notwork

this is example of one wrong image result i got:

result man sitting

dribnet commented 1 year ago

Just a guess based on my experience with other models: you might have to align your alpha layer mask to a 16x16 grid. Try pre-processing your alpha layer assuming the alpha mask is an image made up of 16x16 pixel tiles and expand your original mask to fill those grid tiles.

enzymezoo-code commented 1 year ago

Are you both using an image with alpha and painting the original image black? Can you paint the alpha channel with the mask without modifying the other channels? @grzegorzewskiflyingdog

grzegorzewskiflyingdog commented 1 year ago

im not modify other channels. For alpha channels, only alpha For INIT_IMAGE_ALPHA option i do not use other mask in this case. If i would use black color then i should send two images to server , original one plus mask one, for alpha mask i send only one.