-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Version 14 of Bryce Drennan's imaginAIry package conceived of a very helpful way to abstract away the details of going from SD15 resolution to full hires images using ControlNet:
- Define resolutions for easy retrieval by the user (utils/named_resolutions.py)
- Generate a low-resolution "composition" image (api/generate_refiners.py#L218)
- Use the Tile ControlNet to turn this low-resolution starting point into the final image (api/generate_refiners.py#L260). (Note that in ImaginAIry, 'details' is an alias for control_v11f1e_sd15_tile (see config.py#L345).
Looking at constants.py in the current dev branch, you have already set up Tile-capable ControlNets for all three supported architectures. This would allow stablepy to replicate this user-friendly upscaling method easily.
I propose a new pipeline ultrahdfix (or similar) to do as follows:
- Calculate the correct minimum resolution for the relevant model - 512px for SD15, 1024px for SDXL and FLUX - and generate a correctly scaled image per the user request, e.g. FHD [1920x1080] = 512x288
- Do the initial generation, optionally with detailfix (TileCN does well with details when upscaling, at least in SD15)
- Use ESRGAN to do the initial upscale for the original composition image, allowing the ControlNet model to focus entirely on detailing. (This may need to be done multiple times if the scale factor is greater than 4x; in the example it is 3.75).
- Send the upscaled PIL composition image, prompts (SD) / prompt (FLUX), Loras (SD/FLUX) and embeddings (SD) to the relevant ControlNet for the model architecture.
- Crop the final PIL image to exactly match the correct resolution if required (ESRGAN can sometimes be a few pixels out).
- Provide the final PIL image to the user, with an option to retrieve the composition image for comparison.
As in the source program, the proposed helper pipeline would chain these preexisting steps together to make model-agnostic ultra high-resolution image generation as simple as possible for the user.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request