add control run summary

This commit is contained in:
Vladimir Mandic
2024-05-14 10:07:16 -04:00
parent 343459d690
commit 8576a540ef
2 changed files with 8 additions and 2 deletions
+3
View File
@@ -226,6 +226,9 @@ List of available parameters, run `webui --help` for the full & up-to-date list:
## Notes
> [!TIP]
> If you don't want to use built-in `venv` support and prefer to run SD.Next in your own environment such as *Docker* container, *Conda* environment or any other virtual environment, you can skip `venv` create/activate and launch SD.Next directly using `python launch.py` (command line flags noted above still apply).
### Control
**SD.Next** comes with built-in control for all types of text2image, image2image, video2video and batch processing
+5 -2
View File
@@ -72,6 +72,7 @@ def control_run(units: List[unit.Unit] = [], inputs: List[Image.Image] = [], ini
*input_script_args
):
global instance, pipe, original_pipeline # pylint: disable=global-statement
t_start = time.time()
debug(f'Control: type={unit_type} input={inputs} init={inits} type={input_type}')
if inputs is None or (type(inputs) is list and len(inputs) == 0):
inputs = [None]
@@ -621,12 +622,14 @@ def control_run(units: List[unit.Unit] = [], inputs: List[Image.Image] = [], ini
shared.log.error(f'Control pipeline failed: type={unit_type} units={len(active_model)} error={e}')
errors.display(e, 'Control')
t_end = time.time()
if len(output_images) == 0:
output_images = None
image_txt = 'images=None'
image_txt = '| Images None'
else:
image_str = [f'{image.width}x{image.height}' for image in output_images]
image_txt = f'| Images {len(output_images)} | Size {" ".join(image_str)}'
image_txt = f'| Time {t_end-t_start:.2f}s | Images {len(output_images)} | Size {" ".join(image_str)}'
p.init_images = output_images # may be used for hires
if video_type != 'None' and isinstance(output_images, list):