tryiton 1.0.0 → 1.1.1

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
@@ -60,8 +60,10 @@ Additional options (`mode` and `moderationLevel` for clothing; `numSamples` 1–
60
60
  // Hairstyle try-on (see the HAIRCUTS export for all supported values)
61
61
  await client.tryOnHairstyle({ faceImage, haircut: "BuzzCut", hairColor: "ash blonde" });
62
62
 
63
- // Tattoo try-on
63
+ // Tattoo try-on — place it with free text...
64
64
  await client.tryOnTattoo({ bodyImage, designImage, placement: "on the right forearm, small" });
65
+ // ...or pin the exact spot with a region box (normalized 0–1, from the image's top-left)
66
+ await client.tryOnTattoo({ bodyImage, designImage, region: { x: 0.32, y: 0.18, w: 0.28, h: 0.34 } });
65
67
 
66
68
  // Poll a job manually, or check your credit balance
67
69
  const status = await client.getStatus(jobId); // { status, output, error }
package/dist/index.cjs CHANGED
@@ -134,6 +134,7 @@ var TryItOn = class {
134
134
  body_image: params.bodyImage,
135
135
  design_image: params.designImage,
136
136
  placement: params.placement,
137
+ region: params.region,
137
138
  num_samples: params.numSamples,
138
139
  output_format: params.outputFormat
139
140
  };
package/dist/index.d.cts CHANGED
@@ -68,6 +68,20 @@ interface TryOnHairstyleParams {
68
68
  /** Output image format, "png" or "jpeg". Defaults to "png". */
69
69
  outputFormat?: OutputFormat;
70
70
  }
71
+ /**
72
+ * Rectangle on the body image, normalized 0–1 from its TOP-LEFT corner.
73
+ * Each side must be at least 0.06 of the image.
74
+ */
75
+ interface TattooRegion {
76
+ /** Left edge, 0–1. */
77
+ x: number;
78
+ /** Top edge, 0–1. */
79
+ y: number;
80
+ /** Width, 0–1. */
81
+ w: number;
82
+ /** Height, 0–1. */
83
+ h: number;
84
+ }
71
85
  interface TryOnTattooParams {
72
86
  /** URL or base64 data URL — a close-up of bare skin. */
73
87
  bodyImage: string;
@@ -75,6 +89,12 @@ interface TryOnTattooParams {
75
89
  designImage: string;
76
90
  /** Optional free-text placement/size, max 140 chars. */
77
91
  placement?: string;
92
+ /**
93
+ * Optional exact spot for the ink, as a rectangle on the body image. Pins WHERE
94
+ * the tattoo goes, so `placement` then only describes size/style. Omit it and the
95
+ * placement text alone decides.
96
+ */
97
+ region?: TattooRegion;
78
98
  /** Number of output images, 1–4. Charged per image. */
79
99
  numSamples?: number;
80
100
  /** Output image format, "png" or "jpeg". Defaults to "png". */
@@ -128,4 +148,4 @@ declare class TryItOn {
128
148
  private request;
129
149
  }
130
150
 
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 };
151
+ export { type Category, type Credits, type FetchLike, HAIRCUTS, type JobError, type JobStatus, type Mode, type ModerationLevel, type OutputFormat, type StatusResponse, type TattooRegion, TryItOn, TryItOnError, type TryItOnOptions, type TryOnClothesParams, type TryOnHairstyleParams, type TryOnTattooParams, type WaitOptions, TryItOn as default };
package/dist/index.d.ts CHANGED
@@ -68,6 +68,20 @@ interface TryOnHairstyleParams {
68
68
  /** Output image format, "png" or "jpeg". Defaults to "png". */
69
69
  outputFormat?: OutputFormat;
70
70
  }
71
+ /**
72
+ * Rectangle on the body image, normalized 0–1 from its TOP-LEFT corner.
73
+ * Each side must be at least 0.06 of the image.
74
+ */
75
+ interface TattooRegion {
76
+ /** Left edge, 0–1. */
77
+ x: number;
78
+ /** Top edge, 0–1. */
79
+ y: number;
80
+ /** Width, 0–1. */
81
+ w: number;
82
+ /** Height, 0–1. */
83
+ h: number;
84
+ }
71
85
  interface TryOnTattooParams {
72
86
  /** URL or base64 data URL — a close-up of bare skin. */
73
87
  bodyImage: string;
@@ -75,6 +89,12 @@ interface TryOnTattooParams {
75
89
  designImage: string;
76
90
  /** Optional free-text placement/size, max 140 chars. */
77
91
  placement?: string;
92
+ /**
93
+ * Optional exact spot for the ink, as a rectangle on the body image. Pins WHERE
94
+ * the tattoo goes, so `placement` then only describes size/style. Omit it and the
95
+ * placement text alone decides.
96
+ */
97
+ region?: TattooRegion;
78
98
  /** Number of output images, 1–4. Charged per image. */
79
99
  numSamples?: number;
80
100
  /** Output image format, "png" or "jpeg". Defaults to "png". */
@@ -128,4 +148,4 @@ declare class TryItOn {
128
148
  private request;
129
149
  }
130
150
 
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 };
151
+ export { type Category, type Credits, type FetchLike, HAIRCUTS, type JobError, type JobStatus, type Mode, type ModerationLevel, type OutputFormat, type StatusResponse, type TattooRegion, TryItOn, TryItOnError, type TryItOnOptions, type TryOnClothesParams, type TryOnHairstyleParams, type TryOnTattooParams, type WaitOptions, TryItOn as default };
package/dist/index.js CHANGED
@@ -107,6 +107,7 @@ var TryItOn = class {
107
107
  body_image: params.bodyImage,
108
108
  design_image: params.designImage,
109
109
  placement: params.placement,
110
+ region: params.region,
110
111
  num_samples: params.numSamples,
111
112
  output_format: params.outputFormat
112
113
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tryiton",
3
- "version": "1.0.0",
3
+ "version": "1.1.1",
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
@@ -91,6 +91,21 @@ export interface TryOnHairstyleParams {
91
91
  outputFormat?: OutputFormat;
92
92
  }
93
93
 
94
+ /**
95
+ * Rectangle on the body image, normalized 0–1 from its TOP-LEFT corner.
96
+ * Each side must be at least 0.06 of the image.
97
+ */
98
+ export interface TattooRegion {
99
+ /** Left edge, 0–1. */
100
+ x: number;
101
+ /** Top edge, 0–1. */
102
+ y: number;
103
+ /** Width, 0–1. */
104
+ w: number;
105
+ /** Height, 0–1. */
106
+ h: number;
107
+ }
108
+
94
109
  export interface TryOnTattooParams {
95
110
  /** URL or base64 data URL — a close-up of bare skin. */
96
111
  bodyImage: string;
@@ -98,6 +113,12 @@ export interface TryOnTattooParams {
98
113
  designImage: string;
99
114
  /** Optional free-text placement/size, max 140 chars. */
100
115
  placement?: string;
116
+ /**
117
+ * Optional exact spot for the ink, as a rectangle on the body image. Pins WHERE
118
+ * the tattoo goes, so `placement` then only describes size/style. Omit it and the
119
+ * placement text alone decides.
120
+ */
121
+ region?: TattooRegion;
101
122
  /** Number of output images, 1–4. Charged per image. */
102
123
  numSamples?: number;
103
124
  /** Output image format, "png" or "jpeg". Defaults to "png". */
@@ -213,6 +234,7 @@ export class TryItOn {
213
234
  body_image: params.bodyImage,
214
235
  design_image: params.designImage,
215
236
  placement: params.placement,
237
+ region: params.region,
216
238
  num_samples: params.numSamples,
217
239
  output_format: params.outputFormat,
218
240
  };