Commit a9eef1fb authored by James Railton's avatar James Railton
Browse files

Fix "masked content" in loopback script

The loopback script did not set masked content to original after first loop. So each loop would apply a fill, or latent mask. This would essentially reset progress each loop.

The desired behavior is to use the mask for the first loop, then continue to iterate on the results of the previous loop.
parent 33b85391
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ class Script(scripts.Script):
        all_images = []
        original_init_image = p.init_images
        original_prompt = p.prompt
        original_inpainting_fill = p.inpainting_fill
        state.job_count = loops * batch_count

        initial_color_corrections = [processing.setup_color_correction(p.init_images[0])]
@@ -112,6 +113,7 @@ class Script(scripts.Script):

                last_image = processed.images[0]
                p.init_images = [last_image]
                p.inpainting_fill = 1 # Set "masked content" to "original" for next loop.

                if batch_count == 1:
                    history.append(last_image)
@@ -121,6 +123,8 @@ class Script(scripts.Script):
                history.append(last_image)
                all_images.append(last_image)

            p.inpainting_fill = original_inpainting_fill
                
            if state.interrupted:
                    break