-
Notifications
You must be signed in to change notification settings - Fork 18
Outpainting
FooocusPlus can be used to make an image bigger - to extend it using Outpainting - in up to four directions at once. Unlike upscaling, Outpainting actually adds new content in each of the selected directions, based on the composition of the original image. This is a form of image regeneration and you actually press the Generate button to begin the process. Typically the new additions to the image will seamlessly blend with the original so that there is no indication where the transition occurs.
To begin the Outpainting process, click the Input Image checkbox below the main prompt field then select the Inpaint or Outpaint tab. Click on the Inpaint/Outpaint canvas to load the image that will be Outpainted.
This example image was created with the Default preset with the prompt "Filipino woman" using the Fooocus V2 Spellcasting Druid substyle. In this case I chose to guide the Outpainting process by specifying a main prompt, "Filipino woman, temple background", but prompting is optional.
For the most consistent results, select the preset and styles (including the V2 Substyle if applicable) that were used to create the original image.
The first image was created by selecting all four directions for Outpainting. I ran a batch of four images for this test and in three of them the extensions built on the idea that the subject was walking deeper into the temple - but I was pleasantly surprised with the outcome in the image above which turned the composition on its head by showing the subject leaving the building.
The default behavior of the Outpainter is to extend the image in each selected direction by 30%. This relates to the limitations of SDXL base models, they were designed to produces images at a maximum resolution of about 1024x1024 pixels. Because Outpainting is actually a form of generation, the total area that is added should be no more than 100% of this value. If Outpainting occurs in all four directions the total generative area is four times 30% for a total of 120%. While this does exceed the design specification, typically the results are fine.
In this case the image was created by with the "Bottom" direction selected to make the image slightly taller and provide a slightly more complete view of the subject. The extension is still constrained to 30%, as it would be for all four directions.
In FooocusPlus it was realized that if only Outpainting in one directions there was no reason to be constrained by a fixed 30% extension. The design limits of SDXL imaging would not be exceeded by even full extension of 100%. Or if extending in two directions the extension could potentially total 100%.
To enable this feature click on the Apply Variable Outpaint Extension checkbox located below the directional controls. A slider will appear for each selected direction. In the case of one selected direction the range of the slider is 20% to 100%. The image above was created with a 100% extension in the Bottom direction.
For the image above the Top and Bottom directions were selected and each slider was set to 50%, the maximum value in this case. Incidentally, the two selected directions do not have to be opposites. For example, Right and Bottom could be the two selected directions.
Note that the range for each of the two sliders is 20% to 50%. The minimum value is 20% rather than the traditional fixed value of 30%. This is because of limitations with the Outpainting engine. If Outpainting in more than two directions with extensions of less than 30% then distortions can occur, including repeating patterns, smudging and banding. However, for two directions the minimum values can be somewhat relaxed.
And for reference, the image above shows 30% extensions in the Top and Bottom directions.