Can edge purification be achieved

#1
by HK-wang - opened

Can the function of purifying edges like in Photoshop be achieved, otherwise the edges will be too unnatural and unable to blend with other images.

Thank you for the feedback. I will check it and get back to you.

Hello, could you please try again. I fixed the issue.

@egeorcun
I think something's wrong, lucida almost always gives smears and leftovers
ComfyUI_00020_

Thanks for feedback. I'm gonna working on it and i will let you know

@dummy9966 could you please try the same image on v13 for smears and leftovers?

Update: the new weights (v13) are live, and they specifically target the smears you both reported.

What was happening: with a training mix that intentionally contains a lot of semi-transparent ground truth (glass, glow, smoke), the standard matting losses make faint mid-alpha hedging cheap — so the model left a low-alpha haze on real-photo backgrounds that plain MAE barely registers. We added a background-residue metric to our benchmark to make it visible, then trained with a background-purity hinge objective: a constant-gradient penalty over the region the ground truth marks as pure background (eroded, so legitimate soft edges like fur and glass are untouched), gated so the semi-transparent categories keep their soft supervision.

Measured on our 203-image benchmark against ground truth, the released weights vs the previous ones:

  • mean background residue: 0.0096 -> 0.0091 overall, with the faint-haze share reduced the most
  • overall MAE: 0.0257 -> 0.0250 (still ahead of every model we measure)
  • transparency now also passes the commercial reference we benchmark against (0.0338 vs 0.0343)

Being straight about the remaining gap: occasional isolated low-alpha blobs can still show up on busy backgrounds — reduced, not eliminated. That is the top item for the next iteration.

One practical note: if you are testing through ComfyUI's bundled collection, the lucida.safetensors there is an older snapshot — for the current weights please pull from this repo directly (or try the live demo Space). Would appreciate a re-test on your images.

Follow-up: we have temporarily reverted the repo to the v7 weights. Community testing of the v13 build surfaced a regression our benchmark had missed — on layered artwork (poster/collage-style illustrations) it erased or faded design elements that v7 keeps correctly. The background-haze improvements from v13 are real and will return in the next update together with the artwork fix (we are adding real layered-design training data and a matching benchmark category so this class of regression cannot slip through again). Apologies for the churn — reverting felt more honest than leaving a known regression live.

Sign up or log in to comment