• Rupert Menneer's avatar
    StableDiffusionInpaintingPipeline - resize image w.r.t height and width (#3322) · edb087a2
    Rupert Menneer authored
    
    
    * StableDiffusionInpaintingPipeline now resizes input images and masks w.r.t to passed input height and width. Default is already set to 512. This addresses the common tensor mismatch error. Also moved type check into relevant funciton to keep main pipeline body tidy.
    
    * Fixed StableDiffusionInpaintingPrepareMaskAndMaskedImageTests
    
    Due to previous commit these tests were failing as height and width need to be passed into the prepare_mask_and_masked_image function, I have updated the code and added a height/width variable per unit test as it seemed more appropriate than the current hard coded solution
    
    * Added a resolution test to StableDiffusionInpaintPipelineSlowTests
    
    this unit test simply gets the input and resizes it into some that would fail (e.g. would throw a tensor mismatch error/not a mult of 8). Then passes it through the pipeline and verifies it produces output with correct dims w.r.t the passed height and width
    
    ---------
    Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
    edb087a2
test_stable_diffusion_inpaint.py 25.5 KB