diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-25 09:08:50 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-25 09:08:50 +0200 |
| commit | a77bbc20621bedc9c674a06440a87d28144bc806 (patch) | |
| tree | 28e848f7842e3ac0964d39bcb020a2b5b04f23b8 /lib/hyperstack | |
| parent | dd3503c774d8487d6e578240dec83ca8142adaa3 (diff) | |
photo-enhance: adaptive pipeline with conditional ESRGAN and blended scene grading
Addresses all five priority improvements from photo-enhance-review.md:
1. Conditional ESRGAN (ConditionalESRGANBlend node): portrait and night
scenes skip Real-ESRGAN entirely; indoor/golden_hour use a reduced
blend (0.25–0.60); landscape/beach keep full strength. Confidence-
weighted ratios from CLIP scores soften hard scene-boundary transitions.
2. Blended CLIP scene profiles: CLIPSceneDetect now outputs top-3 scene
scores as a normalised JSON string. AdaptivePhotoGrade blends the
matching grading profiles weighted by confidence instead of hard-
switching on the argmax label — a 55/35/10 landscape/golden_hour/overcast
split produces a weighted average of those three profiles.
3. Conservative depth defaults: DepthSelectiveSharpen background_blur
changed from 0.50 to 0.0 (disabled by default). Foreground sharpening
is kept; background blur can be re-enabled explicitly per shot.
4. EXIF/ICC preservation: copy_exif() in photo-enhance.rb uses exiftool
to restore capture time, camera/lens info, GPS, and ICC profile from
the source file onto the enhanced JPEG after ComfyUI strips metadata.
Embedded thumbnail/preview are excluded to avoid showing the old image.
5. Provenance logging: prompt_id is now passed into the metadata markdown
report. WritePhotoMetadata emits scene_scores and esrgan_mode into the
JSON sidecar. The markdown report now shows top-3 scene confidences,
ESRGAN mode, and ComfyUI prompt ID for reproducibility.
Workflow restructured: CLIPSceneDetect now runs on the original image
(before ESRGAN) so scene scores are available to gate the upscaler.
ConditionalESRGANBlend (node 16) inserted between ESRGAN downscale and
CodeFormer. All downstream nodes receive scene_scores via node 11 outputs.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'lib/hyperstack')
0 files changed, 0 insertions, 0 deletions
