Error in Cosmic Clarity AI4 for Siril

I am using Siril 1.4.2 on Windows 11 25H2. Hardware consists of ThinkPad P50 with Intel Core i7 and 32 Gb RAM. Running the new script for CC gives me this error while sharpening:


I use these settings:

The other options work correctly.

The same error occurs on Linux

Issue (short):
Crash like:

ValueError: operands could not be broadcast together with shapes (512,138) (512,144)

Cause:
ONNX path overwrites original tile size after padding → output is cropped to padded size instead of original → mismatch during _blend().

Fix (diff):

--- CosmicClarity_Native.py
+++ CosmicClarity_Native.py
@@
-    c, h0, w0 = _pad_mult16(chunk2d)
+    c, orig_h, orig_w = _pad_mult16(chunk2d)

-    nchw, h0, w0 = _ort_pad(nchw)
+    nchw, _, _ = _ort_pad(nchw)

-    y = raw[0, 0, :h0, :w0]
+    y = raw[0, 0, :orig_h, :orig_w]

Apply the same pattern to:

  • _infer_stellar
  • _infer_ns
  • _infer_denoise_2d
  • _infer_denoise_rgb

How to apply:

How to apply:

  1. Copy the script:
    %LOCALAPPDATA%\siril-scripts\processing\CosmicClarity_Native.py%APPDATA%\siril\scripts\
  2. Edit the copied file and apply the changes above
  3. Rename the script (e.g.): CosmicClarity_Native_fixed.py
  4. Restart Siril
  5. Run it via:

Scripts → Python Scripts → Scripts → CosmicClarity_Native_fixed

(%APPDATA%\siril\scripts\ or whatever path you configured in Preferences for your own scripts — the goal is to keep a separate copy of the distributed script before the author provides an official fix.)

Hello,

Instead of providing a patch on the forum you should open a MR in the siril-scripts repository.
That would be better.

Cheers