tencentcloud-sdk-nodejs-intl-en 3.0.1358 → 3.0.1360

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tencentcloud-sdk-nodejs-intl-en",
3
- "version": "3.0.1358",
3
+ "version": "3.0.1360",
4
4
  "description": "腾讯云 API NODEJS SDK",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -16,10 +16,12 @@
16
16
  */
17
17
  const models = require("./models");
18
18
  const AbstractClient = require('../../common/abstract_client')
19
- const ImageToImageRequest = models.ImageToImageRequest;
20
19
  const ImageToImageResponse = models.ImageToImageResponse;
21
- const LogoRect = models.LogoRect;
22
20
  const LogoParam = models.LogoParam;
21
+ const ImageToImageRequest = models.ImageToImageRequest;
22
+ const LogoRect = models.LogoRect;
23
+ const ChangeClothesRequest = models.ChangeClothesRequest;
24
+ const ChangeClothesResponse = models.ChangeClothesResponse;
23
25
  const ResultConfig = models.ResultConfig;
24
26
 
25
27
 
@@ -33,6 +35,18 @@ class AiartClient extends AbstractClient {
33
35
  super("aiart.intl.tencentcloudapi.com", "2022-12-29", credential, region, profile);
34
36
  }
35
37
 
38
+ /**
39
+ * This API is used to generate the images of the model changing clothes based on the model photo and the clothes image.
40
+ It supports 1 concurrency by default, which means that up to 1 submitted task can be processed simultaneously. Subsequent tasks can be processed only after ongoing ones are completed.
41
+ * @param {ChangeClothesRequest} req
42
+ * @param {function(string, ChangeClothesResponse):void} cb
43
+ * @public
44
+ */
45
+ ChangeClothes(req, cb) {
46
+ let resp = new ChangeClothesResponse();
47
+ this.request("ChangeClothes", req, resp, cb);
48
+ }
49
+
36
50
  /**
37
51
  * This API is used to transfer the image style based on the image to image technology. Images with small figures, complex gestures or too many figures are not recommended.
38
52
  It supports 3 concurrency by default, which means that up to 3 submitted tasks can be processed simultaneously. Subsequent tasks can be processed only after ongoing ones are completed.
@@ -16,6 +16,90 @@
16
16
  */
17
17
  const AbstractModel = require("../../common/abstract_model");
18
18
 
19
+ /**
20
+ * ImageToImage response structure.
21
+ * @class
22
+ */
23
+ class ImageToImageResponse extends AbstractModel {
24
+ constructor(){
25
+ super();
26
+
27
+ /**
28
+ * Different content is returned depending on the input parameter RspImgType.
29
+ If the value is base64, the Base64 code of the generated image is returned.
30
+ If the value is url, the URL of the generated image is returned. The URL is valid for 1 hour. Save it in time.
31
+ * @type {string || null}
32
+ */
33
+ this.ResultImage = null;
34
+
35
+ /**
36
+ * The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
37
+ * @type {string || null}
38
+ */
39
+ this.RequestId = null;
40
+
41
+ }
42
+
43
+ /**
44
+ * @private
45
+ */
46
+ deserialize(params) {
47
+ if (!params) {
48
+ return;
49
+ }
50
+ this.ResultImage = 'ResultImage' in params ? params.ResultImage : null;
51
+ this.RequestId = 'RequestId' in params ? params.RequestId : null;
52
+
53
+ }
54
+ }
55
+
56
+ /**
57
+ * Logo parameter
58
+ * @class
59
+ */
60
+ class LogoParam extends AbstractModel {
61
+ constructor(){
62
+ super();
63
+
64
+ /**
65
+ * Logo URL
66
+ * @type {string || null}
67
+ */
68
+ this.LogoUrl = null;
69
+
70
+ /**
71
+ * Logo Base64 code. Either the Base64 code or URL must be provided. If both are provided, URL prevails.
72
+ * @type {string || null}
73
+ */
74
+ this.LogoImage = null;
75
+
76
+ /**
77
+ * Coordinates of the logo image in the generated image. The logo image will be stretched according to the coordinates.
78
+ * @type {LogoRect || null}
79
+ */
80
+ this.LogoRect = null;
81
+
82
+ }
83
+
84
+ /**
85
+ * @private
86
+ */
87
+ deserialize(params) {
88
+ if (!params) {
89
+ return;
90
+ }
91
+ this.LogoUrl = 'LogoUrl' in params ? params.LogoUrl : null;
92
+ this.LogoImage = 'LogoImage' in params ? params.LogoImage : null;
93
+
94
+ if (params.LogoRect) {
95
+ let obj = new LogoRect();
96
+ obj.deserialize(params.LogoRect)
97
+ this.LogoRect = obj;
98
+ }
99
+
100
+ }
101
+ }
102
+
19
103
  /**
20
104
  * ImageToImage request structure.
21
105
  * @class
@@ -157,26 +241,36 @@ If the input value is greater than 0, the value will be used as the maximum numb
157
241
  }
158
242
 
159
243
  /**
160
- * ImageToImage response structure.
244
+ * Input box
161
245
  * @class
162
246
  */
163
- class ImageToImageResponse extends AbstractModel {
247
+ class LogoRect extends AbstractModel {
164
248
  constructor(){
165
249
  super();
166
250
 
167
251
  /**
168
- * Different content is returned depending on the input parameter RspImgType.
169
- If the value is base64, the Base64 code of the generated image is returned.
170
- If the value is url, the URL of the generated image is returned. The URL is valid for 1 hour. Save it in time.
171
- * @type {string || null}
252
+ * X-axis coordinate of the upper left corner
253
+ * @type {number || null}
172
254
  */
173
- this.ResultImage = null;
255
+ this.X = null;
174
256
 
175
257
  /**
176
- * The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
177
- * @type {string || null}
258
+ * Y-axis coordinate of the upper left corner
259
+ * @type {number || null}
178
260
  */
179
- this.RequestId = null;
261
+ this.Y = null;
262
+
263
+ /**
264
+ * Box width
265
+ * @type {number || null}
266
+ */
267
+ this.Width = null;
268
+
269
+ /**
270
+ * Box height
271
+ * @type {number || null}
272
+ */
273
+ this.Height = null;
180
274
 
181
275
  }
182
276
 
@@ -187,43 +281,77 @@ If the value is url, the URL of the generated image is returned. The URL is vali
187
281
  if (!params) {
188
282
  return;
189
283
  }
190
- this.ResultImage = 'ResultImage' in params ? params.ResultImage : null;
191
- this.RequestId = 'RequestId' in params ? params.RequestId : null;
284
+ this.X = 'X' in params ? params.X : null;
285
+ this.Y = 'Y' in params ? params.Y : null;
286
+ this.Width = 'Width' in params ? params.Width : null;
287
+ this.Height = 'Height' in params ? params.Height : null;
192
288
 
193
289
  }
194
290
  }
195
291
 
196
292
  /**
197
- * Input box
293
+ * ChangeClothes request structure.
198
294
  * @class
199
295
  */
200
- class LogoRect extends AbstractModel {
296
+ class ChangeClothesRequest extends AbstractModel {
201
297
  constructor(){
202
298
  super();
203
299
 
204
300
  /**
205
- * X-axis coordinate of the upper left corner
206
- * @type {number || null}
301
+ * URL of the model image.
302
+ Image restrictions: The single-edge resolution must be less than 3,000 and greater than 512, and the size after Base64 encoding must be less than 8 MB.
303
+ Input requirements:
304
+ 1. It is recommended to input a frontal model image that at least fully shows the model's body (whole body, upper body or lower body) and avoids large-angle body deflections or complex poses.
305
+ 2. It is recommended to input a 3:4 ratio image for better generation effect.
306
+ 3. It is recommended to keep the category of the original clothes in the model image and the category of the replaced clothes the same, or to keep the original clothes' coverage on the model's body equal to or less than the replaced clothes'. (For example, if you need to change the model to wear shorts, the model in the original input image should also wear shorts instead of long pants.) Otherwise, the generation effect will be impaired.
307
+ * @type {string || null}
207
308
  */
208
- this.X = null;
309
+ this.ModelUrl = null;
209
310
 
210
311
  /**
211
- * Y-axis coordinate of the upper left corner
212
- * @type {number || null}
312
+ * URL of the clothes image.
313
+ Image restrictions: single-side resolution less than 3000 and greater than 512, less than 8MB after conversion to Base64 string.
314
+ Input requirements:
315
+ It is recommended to input a complete front-facing flat image of the clothes, containing only one garment in the image. The type of the clothes supports Upper-body, Lower-body and Dress, and you can choose one from the three. The algorithm will change the model's clothes based on the input model image and the input clothes image.
316
+ * @type {string || null}
213
317
  */
214
- this.Y = null;
318
+ this.ClothesUrl = null;
215
319
 
216
320
  /**
217
- * Box width
218
- * @type {number || null}
321
+ * Type of the clothes, which needs to be consistent with the input clothes image.
322
+ Supported value:
323
+ Upper-body
324
+ Lower-body
325
+ Dress
326
+ * @type {string || null}
219
327
  */
220
- this.Width = null;
328
+ this.ClothesType = null;
221
329
 
222
330
  /**
223
- * Box height
331
+ * Switch indicating whether to add a logo to the generated image. Default value: 1.
332
+ 1: add logo
333
+ 0: do not add logo
334
+ Other values: add logo
335
+ It is recommended to use an obvious logo to indicate that the image result is generated by AI.
224
336
  * @type {number || null}
225
337
  */
226
- this.Height = null;
338
+ this.LogoAdd = null;
339
+
340
+ /**
341
+ * Logo content settings.
342
+ By default, the text "Generated by AI" is added to the bottom right corner of the generated image. You can also use other logo.
343
+ * @type {LogoParam || null}
344
+ */
345
+ this.LogoParam = null;
346
+
347
+ /**
348
+ * Image return method (base64 or url).
349
+ You can specify only one method. Default value: base64.
350
+ The URL is valid for 1 hour.
351
+ It is recommended to choose url when the generated image resolution is large. Using base64 may cause return failure due to the image being too large.
352
+ * @type {string || null}
353
+ */
354
+ this.RspImgType = null;
227
355
 
228
356
  }
229
357
 
@@ -234,39 +362,42 @@ class LogoRect extends AbstractModel {
234
362
  if (!params) {
235
363
  return;
236
364
  }
237
- this.X = 'X' in params ? params.X : null;
238
- this.Y = 'Y' in params ? params.Y : null;
239
- this.Width = 'Width' in params ? params.Width : null;
240
- this.Height = 'Height' in params ? params.Height : null;
365
+ this.ModelUrl = 'ModelUrl' in params ? params.ModelUrl : null;
366
+ this.ClothesUrl = 'ClothesUrl' in params ? params.ClothesUrl : null;
367
+ this.ClothesType = 'ClothesType' in params ? params.ClothesType : null;
368
+ this.LogoAdd = 'LogoAdd' in params ? params.LogoAdd : null;
369
+
370
+ if (params.LogoParam) {
371
+ let obj = new LogoParam();
372
+ obj.deserialize(params.LogoParam)
373
+ this.LogoParam = obj;
374
+ }
375
+ this.RspImgType = 'RspImgType' in params ? params.RspImgType : null;
241
376
 
242
377
  }
243
378
  }
244
379
 
245
380
  /**
246
- * Logo parameter
381
+ * ChangeClothes response structure.
247
382
  * @class
248
383
  */
249
- class LogoParam extends AbstractModel {
384
+ class ChangeClothesResponse extends AbstractModel {
250
385
  constructor(){
251
386
  super();
252
387
 
253
388
  /**
254
- * Logo URL
389
+ * Different content is returned depending on the input parameter RspImgType.
390
+ If the value is base64, the Base64 code of the generated image is returned.
391
+ If the value is url, the URL of the generated image is returned. The URL is valid for 1 hour. Save it in time.
255
392
  * @type {string || null}
256
393
  */
257
- this.LogoUrl = null;
394
+ this.ResultImage = null;
258
395
 
259
396
  /**
260
- * Logo Base64 code. Either the Base64 code or URL must be provided. If both are provided, URL prevails.
397
+ * The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
261
398
  * @type {string || null}
262
399
  */
263
- this.LogoImage = null;
264
-
265
- /**
266
- * Coordinates of the logo image in the generated image. The logo image will be stretched according to the coordinates.
267
- * @type {LogoRect || null}
268
- */
269
- this.LogoRect = null;
400
+ this.RequestId = null;
270
401
 
271
402
  }
272
403
 
@@ -277,14 +408,8 @@ class LogoParam extends AbstractModel {
277
408
  if (!params) {
278
409
  return;
279
410
  }
280
- this.LogoUrl = 'LogoUrl' in params ? params.LogoUrl : null;
281
- this.LogoImage = 'LogoImage' in params ? params.LogoImage : null;
282
-
283
- if (params.LogoRect) {
284
- let obj = new LogoRect();
285
- obj.deserialize(params.LogoRect)
286
- this.LogoRect = obj;
287
- }
411
+ this.ResultImage = 'ResultImage' in params ? params.ResultImage : null;
412
+ this.RequestId = 'RequestId' in params ? params.RequestId : null;
288
413
 
289
414
  }
290
415
  }
@@ -320,10 +445,12 @@ Images with the following resolutions can be generated: origin (The resolution i
320
445
  }
321
446
 
322
447
  module.exports = {
323
- ImageToImageRequest: ImageToImageRequest,
324
448
  ImageToImageResponse: ImageToImageResponse,
325
- LogoRect: LogoRect,
326
449
  LogoParam: LogoParam,
450
+ ImageToImageRequest: ImageToImageRequest,
451
+ LogoRect: LogoRect,
452
+ ChangeClothesRequest: ChangeClothesRequest,
453
+ ChangeClothesResponse: ChangeClothesResponse,
327
454
  ResultConfig: ResultConfig,
328
455
 
329
456
  }