diff --git a/CHANGELOG.md b/CHANGELOG.md index 144887f88..eb0e28ff9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -73,6 +73,8 @@ To use and of the new models, simply select model from *Networks -> Reference* a - don't enable Dynamic Attention by default on platforms that support Flash Attention, thanks @Disty0! - convert offload options into a single choice list, thanks @Disty0! *note*: requires reset of selected offload option +- control module allows reszing of indivudual process override images to match input image + for example: set size->before->method:nearest, mode:fixed or mode:fill - update **IPEX** to 2.1.40+xpu on Linux, thanks @Disty0! - general **ROCm** fixes, thanks @lshqqytiger! - fix full vae previews, thanks @Disty0! diff --git a/modules/control/processors.py b/modules/control/processors.py index 19683f6ea..6c405ce59 100644 --- a/modules/control/processors.py +++ b/modules/control/processors.py @@ -210,16 +210,22 @@ class Processor(): return f'Processor load filed: {processor_id}' def __call__(self, image_input: Image, mode: str = 'RGB', resize_mode: int = 0, resize_name: str = 'None', scale_tab: int = 1, scale_by: float = 1.0, local_config: dict = {}): - if self.processor_id is None or self.processor_id == 'None': - return self.override if self.override is not None else image_input if self.override is not None: debug(f'Control Processor: id="{self.processor_id}" override={self.override}') - image_input = self.override + print('HERE1', image_input) + if image_input is not None and image_input.size != self.override.size: + debug(f'Control resize: op=override image={self.override} width={image_input.width} height={image_input.height} mode={resize_mode} name={resize_name}') + image_input = images.resize_image(resize_mode, self.override, image_input.width, image_input.height, resize_name) + else: + image_input = self.override if resize_mode != 0 and resize_name != 'None': if scale_tab == 1: width_before, height_before = int(image_input.width * scale_by), int(image_input.height * scale_by) debug(f'Control resize: op=before image={image_input} width={width_before} height={height_before} mode={resize_mode} name={resize_name}') image_input = images.resize_image(resize_mode, image_input, width_before, height_before, resize_name) + if self.processor_id is None or self.processor_id == 'None': + print('HERE3', self.override) + return image_input image_process = image_input if image_input is None: # log.error('Control Processor: no input')