Skip to content

Commit

Permalink
feat(api): add strength param to denoise stage
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Nov 13, 2023
1 parent 21d1240 commit 768f478
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/onnx_web/chain/blend_denoise.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def run(
_params: ImageParams,
sources: List[Image.Image],
*,
strength: int = 10,
stage_source: Optional[Image.Image] = None,
callback: Optional[ProgressCallback] = None,
**kwargs,
Expand All @@ -33,7 +34,7 @@ def run(
results = []
for source in sources:
data = cv2.cvtColor(np.array(source), cv2.COLOR_RGB2BGR)
data = cv2.fastNlMeansDenoisingColored(data)
data = cv2.fastNlMeansDenoisingColored(data, None, strength, strength)
results.append(Image.fromarray(cv2.cvtColor(data, cv2.COLOR_BGR2RGB)))

return results

0 comments on commit 768f478

Please sign in to comment.