mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
separate control output folder
This commit is contained in:
+5
-3
@@ -2,16 +2,18 @@
|
||||
|
||||
## Update for 2023-12-30
|
||||
|
||||
- **Improvements**:
|
||||
- control: configurable output folder in settings
|
||||
- cli: sdapi.py allow manual api invoke
|
||||
example: `python cli/sdapi.py /sdapi/v1/sd-models`
|
||||
- **Fixes**:
|
||||
- control: fix input image size
|
||||
- control: fix correct image mode
|
||||
- control: reduce usage of temp files
|
||||
- img2img: clip and blip interrogate
|
||||
- guard against invalid sampler index
|
||||
- reset default cfg scale to 6.0
|
||||
- processing: correct display metadata
|
||||
- **Improvements**:
|
||||
- cli: sdapi.py allow manual api invoke
|
||||
example: `python cli/sdapi.py /sdapi/v1/sd-models`
|
||||
|
||||
## Update for 2023-12-29
|
||||
|
||||
|
||||
@@ -120,6 +120,8 @@ def control_run(units: List[unit.Unit], inputs, inits, unit_type: str, is_genera
|
||||
denoising_strength = denoising_strength,
|
||||
n_iter = batch_count,
|
||||
batch_size = batch_size,
|
||||
outpath_samples=shared.opts.outdir_samples or shared.opts.outdir_control_samples,
|
||||
outpath_grids=shared.opts.outdir_grids or shared.opts.outdir_control_grids,
|
||||
)
|
||||
processing.process_init(p)
|
||||
|
||||
@@ -340,9 +342,10 @@ def control_run(units: List[unit.Unit], inputs, inits, unit_type: str, is_genera
|
||||
if p.resize_mode != 0 and input_image is not None and resize_time == 'Before':
|
||||
debug(f'Control resize: image={input_image} width={width} height={height} mode={p.resize_mode} name={resize_name} sequence={resize_time}')
|
||||
input_image = images.resize_image(p.resize_mode, input_image, width, height, resize_name)
|
||||
p.width = input_image.width
|
||||
p.height = input_image.height
|
||||
debug(f'Control: input image={input_image}')
|
||||
if input_image is not None:
|
||||
p.width = input_image.width
|
||||
p.height = input_image.height
|
||||
debug(f'Control: input image={input_image}')
|
||||
|
||||
# process
|
||||
if input_image is None:
|
||||
|
||||
@@ -104,11 +104,15 @@ def create_paths(opts):
|
||||
create_path(fix_path('outdir_samples'))
|
||||
create_path(fix_path('outdir_txt2img_samples'))
|
||||
create_path(fix_path('outdir_img2img_samples'))
|
||||
create_path(fix_path('outdir_control_samples'))
|
||||
create_path(fix_path('outdir_extras_samples'))
|
||||
create_path(fix_path('outdir_init_images'))
|
||||
create_path(fix_path('outdir_grids'))
|
||||
create_path(fix_path('outdir_txt2img_grids'))
|
||||
create_path(fix_path('outdir_img2img_grids'))
|
||||
create_path(fix_path('outdir_control_grids'))
|
||||
create_path(fix_path('outdir_save'))
|
||||
create_path(fix_path('outdir_video'))
|
||||
create_path(fix_path('styles_dir'))
|
||||
|
||||
|
||||
|
||||
@@ -469,6 +469,7 @@ options_templates.update(options_section(('saving-paths', "Image Naming & Paths"
|
||||
"outdir_samples": OptionInfo("", "Output directory for images", component_args=hide_dirs, folder=True),
|
||||
"outdir_txt2img_samples": OptionInfo("outputs/text", 'Directory for text generate', component_args=hide_dirs, folder=True),
|
||||
"outdir_img2img_samples": OptionInfo("outputs/image", 'Directory for image generate', component_args=hide_dirs, folder=True),
|
||||
"outdir_control_samples": OptionInfo("outputs/control", 'Directory for control generate', component_args=hide_dirs, folder=True),
|
||||
"outdir_extras_samples": OptionInfo("outputs/extras", 'Directory for processed images', component_args=hide_dirs, folder=True),
|
||||
"outdir_save": OptionInfo("outputs/save", "Directory for manually saved images", component_args=hide_dirs, folder=True),
|
||||
"outdir_video": OptionInfo("outputs/video", "Directory for videos", component_args=hide_dirs, folder=True),
|
||||
@@ -480,6 +481,7 @@ options_templates.update(options_section(('saving-paths', "Image Naming & Paths"
|
||||
"outdir_grids": OptionInfo("", "Output directory for grids", component_args=hide_dirs, folder=True),
|
||||
"outdir_txt2img_grids": OptionInfo("outputs/grids", 'Output directory for txt2img grids', component_args=hide_dirs, folder=True),
|
||||
"outdir_img2img_grids": OptionInfo("outputs/grids", 'Output directory for img2img grids', component_args=hide_dirs, folder=True),
|
||||
"outdir_control_grids": OptionInfo("outputs/grids", 'Output directory for control grids', component_args=hide_dirs, folder=True),
|
||||
}))
|
||||
|
||||
options_templates.update(options_section(('ui', "User Interface"), {
|
||||
|
||||
@@ -68,6 +68,7 @@ def pil_to_temp_file(self, img: Image, dir: str, format="png") -> str: # pylint:
|
||||
with tempfile.NamedTemporaryFile(delete=False, suffix=".png", dir=dir) as tmp:
|
||||
name = tmp.name
|
||||
img.save(name, pnginfo=(metadata if use_metadata else None))
|
||||
img.already_saved_as = name
|
||||
size = os.path.getsize(name)
|
||||
shared.log.debug(f'Saving temp: image="{name}" resolution={img.width}x{img.height} size={size}')
|
||||
params = ', '.join([f'{k}: {v}' for k, v in img.info.items()])
|
||||
|
||||
Reference in New Issue
Block a user