The Mode dropdown selects the pipeline for this run:
The dialog's left column holds the Sharpen and Denoise groups; the right column holds Super Resolution and Advanced (chunk, overlap, temporary-stretch assist). Only the controls relevant to the current Mode are visible; the others are hidden to keep the dialog compact.
The Sharpen group bundles two independent capabilities — stellar aberration correction and sharpening itself — behind a single Execute. The Stellar Correction radio row at the top of the group decides which:
Once correction is handled (or skipped), the sharpening controls take over:
The Denoise group has three distinct model options behind a single dropdown:
Independent of model choice, three sliders tune the output:
Denoise RGB channels separately runs the mono denoise model on each of R, G, B independently. When this is enabled, Color Denoise and the full/luminance mode selector are disabled — the mono model has no concept of chroma, so those controls would do nothing. The tooltip on the greyed-out controls explains why.
Super Resolution upscales the image by 2×, 3×, or 4× using a learned prior. The output size is exactly the input size multiplied by the scale:
Unlike interpolation (bilinear, bicubic, Lanczos), the model invents plausible high-frequency detail based on patterns it learned during training. On stars this produces tight, round cores at the new resolution. On extended structure (nebulosity, galaxy arms, dust lanes) it produces plausible texture that reads correctly at the new scale but is not literally what a longer-focal-length scope would have captured. Use with the understanding that this is upscaling with invention, not resolution recovery — it's for printing larger, for cropping into small objects, and for making web-sized versions of large captures look pin-sharp.
GPU is used unconditionally for Super Resolution (the models are heavy enough that CPU inference would be prohibitively slow); the GPU dropdown is hidden when this mode is selected. The sharpen and denoise sub-controls are also hidden — super-resolution runs in isolation.
All AI networks process images in tiles rather than all at once (memory, mostly, and because the training patch size doesn't match arbitrary image sizes). The Advanced group exposes the two knobs that control tiling behavior:
Temporary Stretch for AI (linear assist) is the second major Advanced control. All of these networks were trained on data that's already been visually stretched — because that's what humans look at. If you hand the model raw linear integration data (median pixel value ~0.001, nothing above 0.05) it has nothing to work with and the output looks almost identical to the input. The temporary stretch applies an MTF stretch to the image before inference, runs the network, then reverses the stretch on the output so the result lands in your original linear space.
The Target Median slider (0.01-0.50) sets what median value the stretched image should land at. 0.25 is a good default for most data. If your linear data is already somewhat stretched (bright nebulosity, little background), use a smaller target like 0.15; for very dim linear data (narrowband, short-exposure LRGB), 0.30 may give the model more to work with. The relationship between the median after stretch and the MTF stretch parameter m is:
where M is the stretch function, x is the input value, and m is solved to make M(median) = T. The reverse applies M⁻¹ with the same m.
The Use GPU dropdown is a simple Yes/No. "Yes" means SASpro picks the best available GPU backend (CUDA on NVIDIA, DirectML on any Windows DX12 GPU including Intel/AMD, MPS on Apple Silicon where available, otherwise CPU). "No" forces CPU for the whole run — useful when the GPU is busy with something else or when you want deterministic output for comparing results across machines.
If GPU inference fails mid-run with a recognizable hardware error (kernel mismatch, missing library, CUDA driver mismatch), SASpro catches the exception and reports it with the exact underlying message — not a generic "please install drivers" dialog. This matters because the real error is often "torch and torchvision built against different releases" (which surfaces as operator torchvision::nms does not exist) or "the installed torch expects a HIP/CUDA library the driver doesn't actually support" (which surfaces as an undefined-symbol or load failure). Those are searchable strings; a generic message is not.
If the active document has a mask active when you Execute, SASpro blends the AI output with the original using the mask as alpha:
Mask values are normalized to [0, 1] regardless of their stored dtype (uint8, uint16, float32). White areas get full AI effect; black areas keep their original pixels; grays blend smoothly. Mask size is reconciled to the output size by nearest-neighbor subsampling if different (relevant when super-resolution is active — the mask gets upsampled to the output's larger dimensions). If the mask is identically zero everywhere, the blend is skipped and the original is returned unchanged (prevents a blank mask from silently discarding the processing).
The Apply to dropdown picks the output target:
<original name> [Cosmic Clarity – <mode>] so you can tell them apart.The mono preservation behavior deserves a note: Cosmic Clarity's networks are RGB-only (they expect 3-channel input). If the active image is mono, SASpro expands it to RGB before inference and collapses the output back to a single channel at the end (by averaging the three channels, which are near-identical for mono input). Your mono image stays mono.
The Clear AI Cache button in the bottom-left of the dialog flushes the model weights SASpro has loaded into RAM/VRAM during the current session. The next AI run will take longer because models must reload from disk, but you free up (sometimes substantial) memory. Use when:
The button is disabled during an active run to prevent clearing cache while a model is in use.
The grip handle at the bottom-left of the dialog captures the current UI state as a preset. Drag it onto the SASpro canvas to create a shortcut button for one-click reuse. Drop it directly onto an image to apply the current settings headlessly — no dialog, no further clicks. The preset captures every control: mode, GPU setting, sharpening amounts, denoise strengths, model variants, chunk size, overlap percentage, temporary stretch settings, super-resolution scale, mask application, and target (overwrite vs new view).
SASpro also registers each run as the "Replay Last Action" command, so your bound shortcut (default varies by platform) re-runs Cosmic Clarity with your most recent settings against the current view.
The Cosmic Clarity Satellite dialog is a separate tool with its own icon and menu entry, built for batch processing frame-by-frame satellite trail removal from individual subs before stacking. Key features:
The Satellite dialog has its own ❔ button and its own doc entry; this doc covers the main Sharpen/Denoise/Super Resolution dialog.
deep_denoise_mono_AI4, deep_denoise_color_AI4), Lite denoise, Walking Noise denoise (deep_denoise_*_AI4.1w), super-resolution, and satellite segmentation (satelliteRemovalAI4). All models are developed and trained in-house at SetiAstro; the suite is marketed as SetiAstro Cosmic Clarity and distributed as part of SetiAstro Suite Pro.Each mode is a stage sequence. "Both" chains Sharpen then Denoise with equal progress weighting; "Sharpen", "Denoise", and "Super Resolution" are single-stage. Progress is reported as:
where stage_i is the current stage index, sub_frac is the current stage's own 0-1 progress, and N_stages is the total count. The wait dialog's bar updates smoothly across the entire run even when it crosses stage boundaries.
All networks process the image in overlapping tiles blended with a 2D Hann window:
Tile positions along each image axis start at 0 and advance by stride = chunk − overlap pixels:
with the final tile anchored at N - C so the last tile always ends at the image edge. The output is reconstructed as the pixelwise weighted mean:
Hann windows sum to a near-constant across the overlap region, so this is a true overlap-add synthesis — no seams, no hot spots, no edge dimming. Weight values that happen to be zero (shouldn't occur with Hann + non-zero overlap, but defensively) are replaced with 1 before the divide.
The UI stores overlap as a percentage of chunk size for scale-invariance (so changing chunk size doesn't invisibly change the effective overlap). The pixel count is computed per run:
The C/2 cap exists because overlap above 50% would mean adjacent tiles overlap by more than half their area — the number of tiles explodes and the Hann windows produce diminishing returns in seam suppression. Pre-cap percentages up to 50% are allowed; higher values clamp silently. A legacy pixel-count setting from older SASpro versions is auto-migrated to a percentage at first load.
The networks were trained on visually-stretched data. The temporary-stretch option applies a PixInsight-style midtone transfer function:
with boundary conditions M(0)=0, M(m)=0.5, M(1)=1. Given a target median T (the Target Median slider value), the midtone parameter m is solved to satisfy:
M is applied to the input, the network runs, and the output is unstretched with M⁻¹ using the same m. The round-trip is numerically stable as long as the input median is above zero (which real integration data always is).
Both stellar and non-stellar sharpening use a linear blend between the network output and the input, controlled by the Amount slider:
At a=0 the input is unchanged (the model still runs, but its output is discarded). At a=1 you get the full model output. The linear interpolation is pixelwise, so you can also mask the result after the fact if the global amount isn't quite right in some regions.
When a mask is active, the pixelwise alpha composition:
runs after all stages (including super-resolution). Mask values are normalized to [0, 1]: uint masks divide by np.iinfo(dtype).max, floats above 1 divide by their max, zero-valued masks skip the blend entirely to prevent silent discard. The mask is resampled to the output size via nearest-neighbor index arrays when sizes differ (relevant for super-resolution, where the output is 2-4× the mask dimensions). A final np.isfinite check guards against NaN propagation; a non-finite result causes the processed-only output to be returned instead.
Cosmic Clarity's networks are RGB-only — they expect (H, W, 3) float32 input in [0, 1]. If the active image is mono (shape (H, W) or (H, W, 1)):
The _orig_was_mono flag records the input state at Execute time so the result handler can collapse correctly, even if the user changes the active view mid-run.
GPU Compatibility Mode sets three downstream flags on the engine presets:
execution_mode → "compatibility" (vs "auto") — selects a safer code path in each engine, with no half-precision autocast and no tensor-core-specific kernels.batch_size_override → 1 (vs 0 for auto-batching) — one tile per inference call.sharpen_execution_mode and denoise_execution_mode individually, so each engine knows to use its safe path.The cost is substantial — Compatibility Mode runs can be 3-10× slower than normal — but the safety is real: this is the path that survives on older GPUs, low-VRAM GPUs, and some problematic Windows laptops where the normal path fails cryptically.
Every control's value is saved to QSettings on change (under the cc/ prefix) and restored on dialog open. The load path blocks signals on every widget during setValue/setChecked to prevent a save-during-load cascade — otherwise the first widget would fire its save, which would overwrite the just-loaded values of all later widgets. Chunk size and overlap percentage have their own key pair (cc/chunk_size, cc/overlap_pct) with legacy-pixel-overlap migration on first load from older versions. Dialog geometry is saved to cc/dialog_geometry and restored on open, with a deferred resize via QTimer.singleShot(0, ...) so the restore wins over the layout engine's own sizing pass.
The satellite segmenter is a separate network from the sharpen/denoise models. Its output is a trail mask; the dialog's Sensitivity slider sets the threshold below which mask values are treated as background:
Lower sensitivity = more aggressive segmentation (catches dim trails but may false-positive on bright stars). Default 0.10. "Clip Trail to 0.000" replaces segmented trail pixels with pure black (otherwise the AI-interpolated replacement is used, which gives smoother blending into the surrounding sky). The batch and live-monitor paths run through a dedicated QThread (SatelliteEngineThread) that loads models once and processes files one at a time, emitting per-file progress to the wait dialog.
For scale factor s and input shape (H, W, C):
The channel count is preserved (RGB stays RGB; mono — after the usual expand/collapse round-trip — stays mono). Memory footprint scales as s² for the output buffer; a 4× pass on a 6000×4000 input needs ~1.1 GB just for the output float32 buffer, so the Compatibility Mode batch=1 path is often the only viable option on consumer GPUs at 4×.