Stability-AI / aws-jumpstart-examples

10 stars 6 forks source link

Example with image to image and mask? #2

Open jryebread opened 3 months ago

jryebread commented 3 months ago

Hi there, is there some documentation on how one can use a mask image to do outpainting for the AWS marketplace container for SDXL Jumpstart?

I'm trying to do outpainting, is outpainting endpoint supported on the jumpstart version of SDXL? Or is jumpstart only V1 API? Tried the below payload but the model is returning results where the image that's non transparent and shouldn't be changes is being changed:

"payload": { "text_prompts": [ { "text": "", "weight": 0.01 } ], "cfg_scale": 8, "height": 1024, "width": 1024, "steps": 40, "seed": 42, "sampler": "K_DPMPP_2M", "init_image": source_image_base64, "samples": 1, "mask_image": mask_image_base64, "init_image_mode": "STEP_SCHEDULE", "mask_source": "INIT_IMAGE_ALPHA", }

jryebread commented 3 months ago

image mentions outpainting wish there was an example for it :(

jryebread commented 3 months ago

@palp

palp commented 3 months ago

@jryebread Are you using a mask image or trying to generate one from the init image's alpha channel? The request you provided is doing the latter, and discarding the mask_image you are providing, because you've set mask_source to INIT_IMAGE_ALPHA. The documentation here should reflect the Jumpstart container API for masking. It sounds like you might be trying to provide an alpha-channel coded mask image instead, which isn't the way to use it - the mask image should be black and white if provided, and mask_source should be set to indicate which color is the mask; or you can not provide a mask and use the alpha channel of the init image.