public class ImageToImageRequest extends AbstractModel
header, skipSign
Constructor and Description |
---|
ImageToImageRequest() |
ImageToImageRequest(ImageToImageRequest source)
NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy,
and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy.
|
Modifier and Type | Method and Description |
---|---|
Long |
getEnhanceImage()
Get Switch indicating whether to enhance image clarity.
|
String |
getInputImage()
Get Base64 code of the input mage.
|
String |
getInputUrl()
Get URL of the input mage.
|
Long |
getLogoAdd()
Get Switch indicating whether to add a logo to the generated image.
|
LogoParam |
getLogoParam()
Get Logo content settings.
|
String |
getNegativePrompt()
Get Negative text description.
|
String |
getPrompt()
Get Text description.
|
Long |
getRestoreFace()
Get Maximum number of faces for detail restoration.
|
ResultConfig |
getResultConfig()
Get Configurations of the generated image, including the resolution.
|
String |
getRspImgType()
Get Image return method (base64 or url).
|
Float |
getStrength()
Get Generation strength.
|
String[] |
getStyles()
Get Image style.
|
void |
setEnhanceImage(Long EnhanceImage)
Set Switch indicating whether to enhance image clarity.
|
void |
setInputImage(String InputImage)
Set Base64 code of the input mage.
|
void |
setInputUrl(String InputUrl)
Set URL of the input mage.
|
void |
setLogoAdd(Long LogoAdd)
Set Switch indicating whether to add a logo to the generated image.
|
void |
setLogoParam(LogoParam LogoParam)
Set Logo content settings.
|
void |
setNegativePrompt(String NegativePrompt)
Set Negative text description.
|
void |
setPrompt(String Prompt)
Set Text description.
|
void |
setRestoreFace(Long RestoreFace)
Set Maximum number of faces for detail restoration.
|
void |
setResultConfig(ResultConfig ResultConfig)
Set Configurations of the generated image, including the resolution.
|
void |
setRspImgType(String RspImgType)
Set Image return method (base64 or url).
|
void |
setStrength(Float Strength)
Set Generation strength.
|
void |
setStyles(String[] Styles)
Set Image style.
|
void |
toMap(HashMap<String,String> map,
String prefix)
Internal implementation, normal users should not use it.
|
any, fromJsonString, getBinaryParams, GetHeader, getMultipartRequestParams, getSkipSign, set, SetHeader, setParamArrayObj, setParamArraySimple, setParamObj, setParamSimple, setSkipSign, toJsonString
public ImageToImageRequest()
public ImageToImageRequest(ImageToImageRequest source)
public String getInputImage()
public void setInputImage(String InputImage)
InputImage
- Base64 code of the input mage.
Either the Base64 code or URL must be provided. If both are provided, URL prevails.
Image restrictions: The single-edge resolution must be less than 5,000 and greater than 50, and the size after Base64 encoding must be less than 8 MB. Supported formats include JPG, JPEG, PNG, BMP, TIFF and WEBP.public String getInputUrl()
public void setInputUrl(String InputUrl)
InputUrl
- URL of the input mage.
Either the Base64 code or URL must be provided. If both are provided, URL prevails.
Image restrictions: The single-edge resolution must be less than 5,000 and greater than 50, and the size after Base64 encoding must be less than 8 MB. Supported formats include JPG, JPEG, PNG, BMP, TIFF and WEBP.public String getPrompt()
public void setPrompt(String Prompt)
Prompt
- Text description.
It is used to increase the possibility that the generation result contains the described content.
A maximum of 256 UTF-8 characters are supported.public String getNegativePrompt()
public void setNegativePrompt(String NegativePrompt)
NegativePrompt
- Negative text description.
It is used to reduce the possibility that the generation result contains the described content, but such content cannot be completely avoided.
English is recommended. A maximum of 256 UTF-8 characters are supported.public String[] getStyles()
public void setStyles(String[] Styles)
Styles
- Image style.
Select the desired style from the [Image Style List](https://intl.cloud.tencent.com/document/product/1668/86250?from_cn_redirect=1) and enter the style number.
It is recommended to use only one style. If no style is specified, 201 (anime style) is used by default.public ResultConfig getResultConfig()
public void setResultConfig(ResultConfig ResultConfig)
ResultConfig
- Configurations of the generated image, including the resolution.
Images with the following resolutions can be generated: origin (The resolution is the same as the input image resolution, with the edge resolution of up to 2000. The image will be zoomed out proportionally if the resolution is exceeded.), 768:768 (1:1), 768:1024 (3:4), and 1024:768 (4:3).
If the resolution is not specified, origin is used by default.public Long getLogoAdd()
public void setLogoAdd(Long LogoAdd)
LogoAdd
- Switch indicating whether to add a logo to the generated image. Default value: 1.
1: add logo
0: do not add logo
Other values: add logo
It is recommended to use an obvious logo to indicate that the image result is generated by AI.public LogoParam getLogoParam()
public void setLogoParam(LogoParam LogoParam)
LogoParam
- Logo content settings.
By default, the text "Generated by AI" is added to the bottom right corner of the generated image. You can also use other logo.public Float getStrength()
public void setStrength(Float Strength)
Strength
- Generation strength.
The smaller the strength value, the more the generated image resembles the original image. Value range: (0, 1]. If the strength is not specified, the default value of the model is used.
The recommended value range is 0.6 to 0.8.public String getRspImgType()
public void setRspImgType(String RspImgType)
RspImgType
- Image return method (base64 or url).
You can specify only one method. Default value: base64.
The URL is valid for 1 hour.public Long getEnhanceImage()
public void setEnhanceImage(Long EnhanceImage)
EnhanceImage
- Switch indicating whether to enhance image clarity. Default value: 0.
1: on
0: off
If the switch is turned on, the image clarity will be enhanced and the generation time will increase.public Long getRestoreFace()
public void setRestoreFace(Long RestoreFace)
RestoreFace
- Maximum number of faces for detail restoration. Value range: 0 - 6. Default value: 0.
If the input value is greater than 0, the value will be used as the maximum number of faces with a small area can be restored in each image. The generation time will increase according to the actual number of faces restored.Copyright © 2025. All rights reserved.