Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
OK, I guess the changes in this PR require some explanation. First of all, the simplest way to upscale an image is by using the upscale argument and specifying a file at the CLI, for example:
$ python src/app.py --inference_steps 1 --lcm_model_id stabilityai/sd-turbo --use_offline_model -t -f '/home/monstruosoft/fastsdcpu/results/f834fc7f-f613-42b1-aa54-42d0cefb21d3-1.png' --upscale
Now you can also achieve the same result by passing a JSON file argument, like this:
$ python src/app.py --inference_steps 1 --lcm_model_id stabilityai/sd-turbo --use_offline_model -t --upscale --custom_settings upscale.json
The JSON file has the following format:
An empty tiles array indicates the code to perform the default tiled upscale; however, that is not always enough to obtain a good result, particularly faces might require some extra generation to improve the output, so you can specify custom tile settings in the JSON file, for example:
This will generate a new tile from the specified region of the source image and paste it on the target image (usually a previously upscaled version of the same source file).
What each option does might seem complicated at first and, if needed, I may post an explanation including images to demonstrate their meaning and how each option affects the output.
Note that, at the moment, the JSON file requires manual editing but the idea is that eventually the settings might get generated dynamically from within the GUI versions of FastSD CPU.