tryiton 0.1.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -52,7 +52,7 @@ Image inputs accept a public URL or a base64 data URL (`data:image/png;base64,..
52
52
  | `category` | string | No | Item type: `auto`, `clothing`, `eyewear`, `footwear`, `headwear`, `jewelry`, `accessories`, or `others`. `auto` detects it for you. |
53
53
  | `subcategory` | string | No | Required for `clothing` (`tops`, `bottoms`, `dresses`), `jewelry`, and `accessories`. |
54
54
 
55
- Additional clothing options (`mode`, `numSamples`, `outputFormat`, `seed`) are documented in the [API reference](https://docs.tryiton.now).
55
+ Additional options (`mode` and `moderationLevel` for clothing; `numSamples` 1–4 and `outputFormat` `png`/`jpeg` for every try-on, including hairstyle and tattoo) are documented in the [API reference](https://docs.tryiton.now).
56
56
 
57
57
  ## Other endpoints
58
58
 
package/dist/index.cjs CHANGED
@@ -111,9 +111,6 @@ var TryItOn = class {
111
111
  mode: params.mode,
112
112
  num_samples: params.numSamples,
113
113
  output_format: params.outputFormat,
114
- seed: params.seed,
115
- segmentation_free: params.segmentationFree,
116
- garment_photo_type: params.garmentPhotoType,
117
114
  moderation_level: params.moderationLevel
118
115
  };
119
116
  const res = await this.request("POST", "/tryon/clothes", body);
@@ -121,13 +118,25 @@ var TryItOn = class {
121
118
  }
122
119
  /** Restyle a person's hair. Returns the job id. */
123
120
  async tryOnHairstyle(params) {
124
- const body = { face_image: params.faceImage, haircut: params.haircut, hair_color: params.hairColor };
121
+ const body = {
122
+ face_image: params.faceImage,
123
+ haircut: params.haircut,
124
+ hair_color: params.hairColor,
125
+ num_samples: params.numSamples,
126
+ output_format: params.outputFormat
127
+ };
125
128
  const res = await this.request("POST", "/tryon/hairstyle", body);
126
129
  return res.jobId;
127
130
  }
128
131
  /** Ink a design onto skin. Returns the job id. */
129
132
  async tryOnTattoo(params) {
130
- const body = { body_image: params.bodyImage, design_image: params.designImage, placement: params.placement };
133
+ const body = {
134
+ body_image: params.bodyImage,
135
+ design_image: params.designImage,
136
+ placement: params.placement,
137
+ num_samples: params.numSamples,
138
+ output_format: params.outputFormat
139
+ };
131
140
  const res = await this.request("POST", "/tryon/tattoo", body);
132
141
  return res.jobId;
133
142
  }
package/dist/index.d.cts CHANGED
@@ -36,6 +36,8 @@ interface Credits {
36
36
  }
37
37
  type Category = "auto" | "clothing" | "eyewear" | "footwear" | "headwear" | "jewelry" | "accessories" | "others";
38
38
  type Mode = "performance" | "balanced" | "quality";
39
+ type OutputFormat = "png" | "jpeg";
40
+ type ModerationLevel = "conservative" | "permissive" | "none";
39
41
  interface TryOnClothesParams {
40
42
  /** URL or base64 data URL of the person. */
41
43
  modelImage: string;
@@ -47,18 +49,12 @@ interface TryOnClothesParams {
47
49
  subcategory?: string;
48
50
  /** Quality/speed trade-off (clothing only). */
49
51
  mode?: Mode;
50
- /** Number of output images, 1–4 (clothing only). Charged per image. */
52
+ /** Number of output images, 1–4. Charged per image. */
51
53
  numSamples?: number;
52
- /** "png" or "jpeg" (clothing only). */
53
- outputFormat?: "png" | "jpeg";
54
- /** Fixes randomness (clothing only). */
55
- seed?: number;
56
- /** Advanced (clothing only). */
57
- segmentationFree?: boolean;
58
- /** Advanced hint: "auto" | "model" | "flat-lay" (clothing only). */
59
- garmentPhotoType?: "auto" | "model" | "flat-lay";
60
- /** Advanced (clothing only). */
61
- moderationLevel?: string;
54
+ /** Output image format, "png" or "jpeg". Defaults to "png". */
55
+ outputFormat?: OutputFormat;
56
+ /** Content moderation strictness (clothing only). Defaults to "permissive". */
57
+ moderationLevel?: ModerationLevel;
62
58
  }
63
59
  interface TryOnHairstyleParams {
64
60
  /** URL or base64 data URL of the person's face. */
@@ -67,6 +63,10 @@ interface TryOnHairstyleParams {
67
63
  haircut: string;
68
64
  /** Optional free-text color, e.g. "ash blonde". Omit to keep current color. */
69
65
  hairColor?: string;
66
+ /** Number of output images, 1–4. Charged per image. */
67
+ numSamples?: number;
68
+ /** Output image format, "png" or "jpeg". Defaults to "png". */
69
+ outputFormat?: OutputFormat;
70
70
  }
71
71
  interface TryOnTattooParams {
72
72
  /** URL or base64 data URL — a close-up of bare skin. */
@@ -75,6 +75,10 @@ interface TryOnTattooParams {
75
75
  designImage: string;
76
76
  /** Optional free-text placement/size, max 140 chars. */
77
77
  placement?: string;
78
+ /** Number of output images, 1–4. Charged per image. */
79
+ numSamples?: number;
80
+ /** Output image format, "png" or "jpeg". Defaults to "png". */
81
+ outputFormat?: OutputFormat;
78
82
  }
79
83
  interface WaitOptions {
80
84
  /** How often to poll, in ms. Default 2000. */
@@ -124,4 +128,4 @@ declare class TryItOn {
124
128
  private request;
125
129
  }
126
130
 
127
- export { type Category, type Credits, type FetchLike, HAIRCUTS, type JobError, type JobStatus, type Mode, type StatusResponse, TryItOn, TryItOnError, type TryItOnOptions, type TryOnClothesParams, type TryOnHairstyleParams, type TryOnTattooParams, type WaitOptions, TryItOn as default };
131
+ export { type Category, type Credits, type FetchLike, HAIRCUTS, type JobError, type JobStatus, type Mode, type ModerationLevel, type OutputFormat, type StatusResponse, TryItOn, TryItOnError, type TryItOnOptions, type TryOnClothesParams, type TryOnHairstyleParams, type TryOnTattooParams, type WaitOptions, TryItOn as default };
package/dist/index.d.ts CHANGED
@@ -36,6 +36,8 @@ interface Credits {
36
36
  }
37
37
  type Category = "auto" | "clothing" | "eyewear" | "footwear" | "headwear" | "jewelry" | "accessories" | "others";
38
38
  type Mode = "performance" | "balanced" | "quality";
39
+ type OutputFormat = "png" | "jpeg";
40
+ type ModerationLevel = "conservative" | "permissive" | "none";
39
41
  interface TryOnClothesParams {
40
42
  /** URL or base64 data URL of the person. */
41
43
  modelImage: string;
@@ -47,18 +49,12 @@ interface TryOnClothesParams {
47
49
  subcategory?: string;
48
50
  /** Quality/speed trade-off (clothing only). */
49
51
  mode?: Mode;
50
- /** Number of output images, 1–4 (clothing only). Charged per image. */
52
+ /** Number of output images, 1–4. Charged per image. */
51
53
  numSamples?: number;
52
- /** "png" or "jpeg" (clothing only). */
53
- outputFormat?: "png" | "jpeg";
54
- /** Fixes randomness (clothing only). */
55
- seed?: number;
56
- /** Advanced (clothing only). */
57
- segmentationFree?: boolean;
58
- /** Advanced hint: "auto" | "model" | "flat-lay" (clothing only). */
59
- garmentPhotoType?: "auto" | "model" | "flat-lay";
60
- /** Advanced (clothing only). */
61
- moderationLevel?: string;
54
+ /** Output image format, "png" or "jpeg". Defaults to "png". */
55
+ outputFormat?: OutputFormat;
56
+ /** Content moderation strictness (clothing only). Defaults to "permissive". */
57
+ moderationLevel?: ModerationLevel;
62
58
  }
63
59
  interface TryOnHairstyleParams {
64
60
  /** URL or base64 data URL of the person's face. */
@@ -67,6 +63,10 @@ interface TryOnHairstyleParams {
67
63
  haircut: string;
68
64
  /** Optional free-text color, e.g. "ash blonde". Omit to keep current color. */
69
65
  hairColor?: string;
66
+ /** Number of output images, 1–4. Charged per image. */
67
+ numSamples?: number;
68
+ /** Output image format, "png" or "jpeg". Defaults to "png". */
69
+ outputFormat?: OutputFormat;
70
70
  }
71
71
  interface TryOnTattooParams {
72
72
  /** URL or base64 data URL — a close-up of bare skin. */
@@ -75,6 +75,10 @@ interface TryOnTattooParams {
75
75
  designImage: string;
76
76
  /** Optional free-text placement/size, max 140 chars. */
77
77
  placement?: string;
78
+ /** Number of output images, 1–4. Charged per image. */
79
+ numSamples?: number;
80
+ /** Output image format, "png" or "jpeg". Defaults to "png". */
81
+ outputFormat?: OutputFormat;
78
82
  }
79
83
  interface WaitOptions {
80
84
  /** How often to poll, in ms. Default 2000. */
@@ -124,4 +128,4 @@ declare class TryItOn {
124
128
  private request;
125
129
  }
126
130
 
127
- export { type Category, type Credits, type FetchLike, HAIRCUTS, type JobError, type JobStatus, type Mode, type StatusResponse, TryItOn, TryItOnError, type TryItOnOptions, type TryOnClothesParams, type TryOnHairstyleParams, type TryOnTattooParams, type WaitOptions, TryItOn as default };
131
+ export { type Category, type Credits, type FetchLike, HAIRCUTS, type JobError, type JobStatus, type Mode, type ModerationLevel, type OutputFormat, type StatusResponse, TryItOn, TryItOnError, type TryItOnOptions, type TryOnClothesParams, type TryOnHairstyleParams, type TryOnTattooParams, type WaitOptions, TryItOn as default };
package/dist/index.js CHANGED
@@ -84,9 +84,6 @@ var TryItOn = class {
84
84
  mode: params.mode,
85
85
  num_samples: params.numSamples,
86
86
  output_format: params.outputFormat,
87
- seed: params.seed,
88
- segmentation_free: params.segmentationFree,
89
- garment_photo_type: params.garmentPhotoType,
90
87
  moderation_level: params.moderationLevel
91
88
  };
92
89
  const res = await this.request("POST", "/tryon/clothes", body);
@@ -94,13 +91,25 @@ var TryItOn = class {
94
91
  }
95
92
  /** Restyle a person's hair. Returns the job id. */
96
93
  async tryOnHairstyle(params) {
97
- const body = { face_image: params.faceImage, haircut: params.haircut, hair_color: params.hairColor };
94
+ const body = {
95
+ face_image: params.faceImage,
96
+ haircut: params.haircut,
97
+ hair_color: params.hairColor,
98
+ num_samples: params.numSamples,
99
+ output_format: params.outputFormat
100
+ };
98
101
  const res = await this.request("POST", "/tryon/hairstyle", body);
99
102
  return res.jobId;
100
103
  }
101
104
  /** Ink a design onto skin. Returns the job id. */
102
105
  async tryOnTattoo(params) {
103
- const body = { body_image: params.bodyImage, design_image: params.designImage, placement: params.placement };
106
+ const body = {
107
+ body_image: params.bodyImage,
108
+ design_image: params.designImage,
109
+ placement: params.placement,
110
+ num_samples: params.numSamples,
111
+ output_format: params.outputFormat
112
+ };
104
113
  const res = await this.request("POST", "/tryon/tattoo", body);
105
114
  return res.jobId;
106
115
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tryiton",
3
- "version": "0.1.0",
3
+ "version": "1.0.0",
4
4
  "description": "Official JavaScript/TypeScript SDK for the TryItOn virtual try-on API.",
5
5
  "keywords": [
6
6
  "tryiton",
package/src/index.ts CHANGED
@@ -55,6 +55,10 @@ export type Category =
55
55
 
56
56
  export type Mode = "performance" | "balanced" | "quality";
57
57
 
58
+ export type OutputFormat = "png" | "jpeg";
59
+
60
+ export type ModerationLevel = "conservative" | "permissive" | "none";
61
+
58
62
  export interface TryOnClothesParams {
59
63
  /** URL or base64 data URL of the person. */
60
64
  modelImage: string;
@@ -66,18 +70,12 @@ export interface TryOnClothesParams {
66
70
  subcategory?: string;
67
71
  /** Quality/speed trade-off (clothing only). */
68
72
  mode?: Mode;
69
- /** Number of output images, 1–4 (clothing only). Charged per image. */
73
+ /** Number of output images, 1–4. Charged per image. */
70
74
  numSamples?: number;
71
- /** "png" or "jpeg" (clothing only). */
72
- outputFormat?: "png" | "jpeg";
73
- /** Fixes randomness (clothing only). */
74
- seed?: number;
75
- /** Advanced (clothing only). */
76
- segmentationFree?: boolean;
77
- /** Advanced hint: "auto" | "model" | "flat-lay" (clothing only). */
78
- garmentPhotoType?: "auto" | "model" | "flat-lay";
79
- /** Advanced (clothing only). */
80
- moderationLevel?: string;
75
+ /** Output image format, "png" or "jpeg". Defaults to "png". */
76
+ outputFormat?: OutputFormat;
77
+ /** Content moderation strictness (clothing only). Defaults to "permissive". */
78
+ moderationLevel?: ModerationLevel;
81
79
  }
82
80
 
83
81
  export interface TryOnHairstyleParams {
@@ -87,6 +85,10 @@ export interface TryOnHairstyleParams {
87
85
  haircut: string;
88
86
  /** Optional free-text color, e.g. "ash blonde". Omit to keep current color. */
89
87
  hairColor?: string;
88
+ /** Number of output images, 1–4. Charged per image. */
89
+ numSamples?: number;
90
+ /** Output image format, "png" or "jpeg". Defaults to "png". */
91
+ outputFormat?: OutputFormat;
90
92
  }
91
93
 
92
94
  export interface TryOnTattooParams {
@@ -96,6 +98,10 @@ export interface TryOnTattooParams {
96
98
  designImage: string;
97
99
  /** Optional free-text placement/size, max 140 chars. */
98
100
  placement?: string;
101
+ /** Number of output images, 1–4. Charged per image. */
102
+ numSamples?: number;
103
+ /** Output image format, "png" or "jpeg". Defaults to "png". */
104
+ outputFormat?: OutputFormat;
99
105
  }
100
106
 
101
107
  export interface WaitOptions {
@@ -182,9 +188,6 @@ export class TryItOn {
182
188
  mode: params.mode,
183
189
  num_samples: params.numSamples,
184
190
  output_format: params.outputFormat,
185
- seed: params.seed,
186
- segmentation_free: params.segmentationFree,
187
- garment_photo_type: params.garmentPhotoType,
188
191
  moderation_level: params.moderationLevel,
189
192
  };
190
193
  const res = await this.request<{ jobId: string }>("POST", "/tryon/clothes", body);
@@ -193,14 +196,26 @@ export class TryItOn {
193
196
 
194
197
  /** Restyle a person's hair. Returns the job id. */
195
198
  async tryOnHairstyle(params: TryOnHairstyleParams): Promise<string> {
196
- const body = { face_image: params.faceImage, haircut: params.haircut, hair_color: params.hairColor };
199
+ const body = {
200
+ face_image: params.faceImage,
201
+ haircut: params.haircut,
202
+ hair_color: params.hairColor,
203
+ num_samples: params.numSamples,
204
+ output_format: params.outputFormat,
205
+ };
197
206
  const res = await this.request<{ jobId: string }>("POST", "/tryon/hairstyle", body);
198
207
  return res.jobId;
199
208
  }
200
209
 
201
210
  /** Ink a design onto skin. Returns the job id. */
202
211
  async tryOnTattoo(params: TryOnTattooParams): Promise<string> {
203
- const body = { body_image: params.bodyImage, design_image: params.designImage, placement: params.placement };
212
+ const body = {
213
+ body_image: params.bodyImage,
214
+ design_image: params.designImage,
215
+ placement: params.placement,
216
+ num_samples: params.numSamples,
217
+ output_format: params.outputFormat,
218
+ };
204
219
  const res = await this.request<{ jobId: string }>("POST", "/tryon/tattoo", body);
205
220
  return res.jobId;
206
221
  }