feat(settings): add base path support for output folders

Change "Images folder" and "Grids folder" settings to act as base paths
that combine with specific folder settings, rather than replacing them.

- Add resolve_output_path() helper function to modules/paths.py
- Update all output path usages to use combined base + specific paths
- Update gallery API to return resolved paths with display labels
- Update gallery UI to show short labels with full path on hover

Example: If base is "C:\Database\" and specific is "outputs/text",
the resolved path becomes "C:\Database\outputs\text"

Edge cases handled:
- Empty base path: uses specific path directly (backward compatible)
- Absolute specific path: ignores base path
- Empty specific path: uses base path only
This commit is contained in:
CalamitousFelicitousness
2026-01-16 09:29:48 +00:00
parent b3d65f4559
commit 761ea1c327
14 changed files with 150 additions and 57 deletions
+2 -1
View File
@@ -6,6 +6,7 @@ from PIL import Image
from modules import shared, images, devices, scripts_manager, scripts_postprocessing, infotext
from modules.shared import opts
from modules.paths import resolve_output_path
def run_postprocessing(extras_mode, image, image_folder: List[tempfile.NamedTemporaryFile], input_dir, output_dir, show_extras_results, *args, save_output: bool = True):
@@ -58,7 +59,7 @@ def run_postprocessing(extras_mode, image, image_folder: List[tempfile.NamedTemp
if extras_mode == 2 and output_dir != '':
outpath = output_dir
else:
outpath = opts.outdir_samples or opts.outdir_extras_samples
outpath = resolve_output_path(opts.outdir_samples, opts.outdir_extras_samples)
processed_images = []
for image, name, ext in zip(image_data, image_names, image_ext): # pylint: disable=redefined-argument-from-local
shared.log.debug(f'Process: image={image} {args}')