From 8e52e8716012c8b3a55089ce364b5041657d2ddc Mon Sep 17 00:00:00 2001 From: 0xBitBuster Date: Thu, 26 Nov 2026 17:11:40 +0100 Subject: [PATCH] Deprecate mode and moderation_level on fashion try-on The API ignores `mode` and validates `moderation_level` without applying it (the AI providers' own safety filters always apply). Both stay accepted and are marked deprecated for removal in the next major version. Passing either now emits a DeprecationWarning. Also dates the 2.1.0 changelog entry and points its compare link at the v2.1.0 tag. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 11 +++++++++-- tryiton/client.py | 14 ++++++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 471944e..a0481f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,13 @@ All notable changes to the `tryiton` Python SDK are documented here. The format [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [2.1.0] - Unreleased +## [Unreleased] + +### Deprecated + +- `try_on_fashion(mode=..., moderation_level=...)`: the API ignores `mode` and validates `moderation_level` without applying it. Passing either now emits a `DeprecationWarning`; both are removed in 3.0. + +## [2.1.0] - 2026-11-26 ### Added @@ -60,7 +66,8 @@ All notable changes to the `tryiton` Python SDK are documented here. The format - Initial release: clothing/accessory, hairstyle and tattoo try-on, `get_status`, `get_credits` and the `wait_for_result` polling helper. -[2.1.0]: https://github.com/tryiton-now/tryiton-python/compare/v2.0.0...HEAD +[Unreleased]: https://github.com/tryiton-now/tryiton-python/compare/v2.1.0...HEAD +[2.1.0]: https://github.com/tryiton-now/tryiton-python/compare/v2.0.0...v2.1.0 [2.0.0]: https://github.com/tryiton-now/tryiton-python/compare/v1.1.0...v2.0.0 [1.1.0]: https://github.com/tryiton-now/tryiton-python/compare/v1.0.0...v1.1.0 [1.0.0]: https://github.com/tryiton-now/tryiton-python/compare/v0.1.0...v1.0.0 diff --git a/tryiton/client.py b/tryiton/client.py index 04906f6..a5188c8 100644 --- a/tryiton/client.py +++ b/tryiton/client.py @@ -3,6 +3,7 @@ from __future__ import annotations import time +import warnings from typing import Any, Dict, List, Optional, cast from urllib.parse import quote @@ -87,9 +88,18 @@ def try_on_fashion( `category` is one of auto | clothing | eyewear | footwear | headwear | jewelry | accessories | others. `clothing`, `jewelry`, and `accessories` require a `subcategory`. `num_samples` is 1-4 (charged per image), - `output_format` is "png" or "jpeg", and `moderation_level` is one of - "conservative", "permissive", or "none". + and `output_format` is "png" or "jpeg". + + Deprecated: `mode` is ignored by the API, and `moderation_level` is + validated but has no effect. Both emit a DeprecationWarning and will be + removed in 3.0. """ + if mode is not None or moderation_level is not None: + warnings.warn( + "try_on_fashion: `mode` and `moderation_level` have no effect and will be removed in 3.0", + DeprecationWarning, + stacklevel=2, + ) body = { "model_image": model_image, "garment_image": garment_image,