Documentation
¶
Index ¶
- func Bool(b bool) param.Opt[bool]
- func BoolPtr(v bool) *bool
- func DefaultClientOptions() []option.RequestOption
- func File(rdr io.Reader, filename string, contentType string) file
- func Float(f float64) param.Opt[float64]
- func FloatPtr(v float64) *float64
- func Int(i int64) param.Opt[int64]
- func IntPtr(v int64) *int64
- func Opt[T comparable](v T) param.Opt[T]
- func Ptr[T any](v T) *T
- func String(s string) param.Opt[string]
- func StringPtr(v string) *string
- func Time(t time.Time) param.Opt[time.Time]
- func TimePtr(v time.Time) *time.Time
- type AspectRatio
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, ...) error
- func (r *Client) Get(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Post(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Put(ctx context.Context, path string, params any, res any, ...) error
- type ColorPaletteColorPaletteWithMembersMemberParam
- type ColorPaletteColorPaletteWithMembersParam
- type ColorPaletteColorPaletteWithPresetNameParam
- type ColorPaletteUnionParam
- type DescribeNewParams
- type DescribeNewResponse
- type DescribeNewResponseDescription
- type DescribeService
- type EditApplyParams
- type EditService
- type Error
- type GenerateImage
- type GenerateImageData
- type GenerateNewParams
- type GenerateService
- type IdeogramV3EditParams
- type IdeogramV3GenerateParams
- type IdeogramV3ReframeParams
- type IdeogramV3RemixParams
- type IdeogramV3ReplaceBackgroundParams
- type IdeogramV3Service
- func (r *IdeogramV3Service) Edit(ctx context.Context, body IdeogramV3EditParams, opts ...option.RequestOption) (res *ImageGenerationResponse, err error)
- func (r *IdeogramV3Service) Generate(ctx context.Context, body IdeogramV3GenerateParams, ...) (res *ImageGenerationResponse, err error)
- func (r *IdeogramV3Service) Reframe(ctx context.Context, body IdeogramV3ReframeParams, ...) (res *ImageGenerationResponse, err error)
- func (r *IdeogramV3Service) Remix(ctx context.Context, body IdeogramV3RemixParams, opts ...option.RequestOption) (res *ImageGenerationResponse, err error)
- func (r *IdeogramV3Service) ReplaceBackground(ctx context.Context, body IdeogramV3ReplaceBackgroundParams, ...) (res *ImageGenerationResponse, err error)
- type ImageGenerationResponse
- type ImageGenerationResponseData
- type ImageRequestAspectRatio
- type ImageRequestParam
- type InternalTestingNewParams
- type InternalTestingNewParamsEnumTypeField
- type InternalTestingNewParamsNestedObjectRequiredFields
- type InternalTestingNewResponse
- type InternalTestingService
- type MagicPromptOption
- type MagicPromptVersionEnum
- type ManageAPIAPIKeyService
- func (r *ManageAPIAPIKeyService) Delete(ctx context.Context, apiKeyID string, opts ...option.RequestOption) (err error)
- func (r *ManageAPIAPIKeyService) Get(ctx context.Context, opts ...option.RequestOption) (res *ManageApiapiKeyGetResponse, err error)
- func (r *ManageAPIAPIKeyService) New(ctx context.Context, opts ...option.RequestOption) (res *ManageApiapiKeyNewResponse, err error)
- type ManageAPIAddCreditsParams
- type ManageAPIAddCreditsResponse
- type ManageAPIGetStripeSubscriptionParams
- type ManageAPIGetStripeSubscriptionResponse
- type ManageAPIReactivateResponse
- type ManageAPIService
- func (r *ManageAPIService) AddCredits(ctx context.Context, body ManageAPIAddCreditsParams, ...) (res *ManageAPIAddCreditsResponse, err error)
- func (r *ManageAPIService) GetStripeSubscription(ctx context.Context, query ManageAPIGetStripeSubscriptionParams, ...) (res *ManageAPIGetStripeSubscriptionResponse, err error)
- func (r *ManageAPIService) Reactivate(ctx context.Context, opts ...option.RequestOption) (res *ManageAPIReactivateResponse, err error)
- type ManageAPISubscriptionGetResponse
- type ManageAPISubscriptionGetResponseMetronomeLinks
- type ManageAPISubscriptionService
- func (r *ManageAPISubscriptionService) Get(ctx context.Context, opts ...option.RequestOption) (res *ManageAPISubscriptionGetResponse, err error)
- func (r *ManageAPISubscriptionService) Update(ctx context.Context, body ManageAPISubscriptionUpdateParams, ...) (res *ManageAPISubscriptionUpdateResponse, err error)
- type ManageAPISubscriptionUpdateParams
- type ManageAPISubscriptionUpdateResponse
- type ManageAPITermAcceptParams
- type ManageAPITermGetResponse
- type ManageAPITermGetResponseAPITerms
- type ManageAPITermService
- type ManageApiapiKeyGetResponse
- type ManageApiapiKeyGetResponseCurrentAPIKey
- type ManageApiapiKeyNewResponse
- type ManageService
- type ModelEnum
- type NestedObjectParam
- type Price
- type PriceParam
- type RechargeSettingsResponse
- type RechargeSettingsSubscription
- type RechargeSettingsSubscriptionParam
- type ReframeNewParams
- type ReframeService
- type RemixNewParams
- type RemixNewParamsImageRequest
- type RemixService
- type RenderingSpeed
- type ResolutionIdeogram
- type ResolutionImageGeneration
- type StyleTypeV2AndAbove
- type StyleTypeV3
- type UpscaleNewParams
- type UpscaleNewParamsImageRequest
- type UpscaleService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (IDEOGRAM_SDK_API_KEY, IDEOGRAM_SDK_BEARER_TOKEN, IDEOGRAM_SDK_BASE_URL). This should be used to initialize new clients.
func Opt ¶
func Opt[T comparable](v T) param.Opt[T]
Types ¶
type AspectRatio ¶
type AspectRatio string
The aspect ratio to use for image generation, which determines the image's resolution. Cannot be used in conjunction with resolution. Defaults to 1x1.
const ( AspectRatio1x3 AspectRatio = "1x3" AspectRatio3x1 AspectRatio = "3x1" AspectRatio1x2 AspectRatio = "1x2" AspectRatio2x1 AspectRatio = "2x1" AspectRatio9x16 AspectRatio = "9x16" AspectRatio16x9 AspectRatio = "16x9" AspectRatio10x16 AspectRatio = "10x16" AspectRatio16x10 AspectRatio = "16x10" AspectRatio2x3 AspectRatio = "2x3" AspectRatio3x2 AspectRatio = "3x2" AspectRatio3x4 AspectRatio = "3x4" AspectRatio4x3 AspectRatio = "4x3" AspectRatio4x5 AspectRatio = "4x5" AspectRatio5x4 AspectRatio = "5x4" AspectRatio1x1 AspectRatio = "1x1" )
type Client ¶
type Client struct { Options []option.RequestOption Describe DescribeService Edit EditService Generate GenerateService InternalTesting InternalTestingService Manage ManageService Reframe ReframeService Remix RemixService Upscale UpscaleService IdeogramV3 IdeogramV3Service }
Client creates a struct with services and top level methods that help with interacting with the ideogram-sdk API. You should not instantiate this client directly, and instead use the NewClient method instead.
func NewClient ¶
func NewClient(opts ...option.RequestOption) (r Client)
NewClient generates a new client with the default option read from the environment (IDEOGRAM_SDK_API_KEY, IDEOGRAM_SDK_BEARER_TOKEN, IDEOGRAM_SDK_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶
func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶
func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Patch ¶
func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type ColorPaletteColorPaletteWithMembersMemberParam ¶
type ColorPaletteColorPaletteWithMembersMemberParam struct { // The hexadecimal representation of the color with an optional chosen weight. ColorHex string `json:"color_hex,required"` // The weight of the color in the color palette. ColorWeight param.Opt[float64] `json:"color_weight,omitzero"` // contains filtered or unexported fields }
A member of a color palette.
The property ColorHex is required.
func (ColorPaletteColorPaletteWithMembersMemberParam) MarshalJSON ¶
func (r ColorPaletteColorPaletteWithMembersMemberParam) MarshalJSON() (data []byte, err error)
func (*ColorPaletteColorPaletteWithMembersMemberParam) UnmarshalJSON ¶
func (r *ColorPaletteColorPaletteWithMembersMemberParam) UnmarshalJSON(data []byte) error
type ColorPaletteColorPaletteWithMembersParam ¶
type ColorPaletteColorPaletteWithMembersParam struct { // A list of ColorPaletteMembers that define the color palette. Each color palette // member consists of a required color hex and an optional weight between 0.05 and // 1.0 (inclusive). It is recommended that these weights descend from highest to // lowest for the color hexes provided. Members []ColorPaletteColorPaletteWithMembersMemberParam `json:"members,omitzero,required"` // contains filtered or unexported fields }
A color palette represented only via its members. Cannot be used in conjunction with preset name.
The property Members is required.
func (ColorPaletteColorPaletteWithMembersParam) MarshalJSON ¶
func (r ColorPaletteColorPaletteWithMembersParam) MarshalJSON() (data []byte, err error)
func (*ColorPaletteColorPaletteWithMembersParam) UnmarshalJSON ¶
func (r *ColorPaletteColorPaletteWithMembersParam) UnmarshalJSON(data []byte) error
type ColorPaletteColorPaletteWithPresetNameParam ¶
type ColorPaletteColorPaletteWithPresetNameParam struct { // A color palette preset value. // // Any of "EMBER", "FRESH", "JUNGLE", "MAGIC", "MELON", "MOSAIC", "PASTEL", // "ULTRAMARINE". Name string `json:"name,omitzero,required"` // contains filtered or unexported fields }
The property Name is required.
func (ColorPaletteColorPaletteWithPresetNameParam) MarshalJSON ¶
func (r ColorPaletteColorPaletteWithPresetNameParam) MarshalJSON() (data []byte, err error)
func (*ColorPaletteColorPaletteWithPresetNameParam) UnmarshalJSON ¶
func (r *ColorPaletteColorPaletteWithPresetNameParam) UnmarshalJSON(data []byte) error
type ColorPaletteUnionParam ¶
type ColorPaletteUnionParam struct { OfColorPaletteWithPresetName *ColorPaletteColorPaletteWithPresetNameParam `json:",omitzero,inline"` OfColorPaletteWithMembers *ColorPaletteColorPaletteWithMembersParam `json:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func ColorPaletteParamOfColorPaletteWithMembers ¶
func ColorPaletteParamOfColorPaletteWithMembers(members []ColorPaletteColorPaletteWithMembersMemberParam) ColorPaletteUnionParam
func ColorPaletteParamOfColorPaletteWithPresetName ¶
func ColorPaletteParamOfColorPaletteWithPresetName(name string) ColorPaletteUnionParam
func (ColorPaletteUnionParam) MarshalJSON ¶
func (u ColorPaletteUnionParam) MarshalJSON() ([]byte, error)
func (*ColorPaletteUnionParam) UnmarshalJSON ¶
func (u *ColorPaletteUnionParam) UnmarshalJSON(data []byte) error
type DescribeNewParams ¶
type DescribeNewParams struct { // An image binary (max size 10MB); only JPEG, WebP and PNG formats are supported // at this time. ImageFile io.Reader `json:"image_file,omitzero,required" format:"binary"` // contains filtered or unexported fields }
func (DescribeNewParams) MarshalMultipart ¶
func (r DescribeNewParams) MarshalMultipart() (data []byte, contentType string, err error)
type DescribeNewResponse ¶
type DescribeNewResponse struct { // A collection of descriptions for given content. Descriptions []DescribeNewResponseDescription `json:"descriptions"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Descriptions respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
The response for a describe request encapsulates a list of descriptions.
func (DescribeNewResponse) RawJSON ¶
func (r DescribeNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*DescribeNewResponse) UnmarshalJSON ¶
func (r *DescribeNewResponse) UnmarshalJSON(data []byte) error
type DescribeNewResponseDescription ¶
type DescribeNewResponseDescription struct { // The generated description for the provided image. Text string `json:"text"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Text respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (DescribeNewResponseDescription) RawJSON ¶
func (r DescribeNewResponseDescription) RawJSON() string
Returns the unmodified JSON received from the API
func (*DescribeNewResponseDescription) UnmarshalJSON ¶
func (r *DescribeNewResponseDescription) UnmarshalJSON(data []byte) error
type DescribeService ¶
type DescribeService struct {
Options []option.RequestOption
}
DescribeService contains methods and other services that help with interacting with the ideogram-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewDescribeService method instead.
func NewDescribeService ¶
func NewDescribeService(opts ...option.RequestOption) (r DescribeService)
NewDescribeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*DescribeService) New ¶
func (r *DescribeService) New(ctx context.Context, body DescribeNewParams, opts ...option.RequestOption) (res *DescribeNewResponse, err error)
Describe an image.
Supported image formats include JPEG, PNG, and WebP.
type EditApplyParams ¶
type EditApplyParams struct { // An image binary (max size 10MB); only JPEG, WebP and PNG formats are supported // at this time. ImageFile io.Reader `json:"image_file,omitzero,required" format:"binary"` // A black and white image of the same size as the image being edited (max size // 10MB). Black regions in the mask should match up with the regions of the image // that you would like to edit; only JPEG, WebP and PNG formats are supported at // this time. Mask io.Reader `json:"mask,omitzero,required" format:"binary"` // The model used to generate an image or edit one. /generate and /remix supports // all model types, however, /edit is only supported for V_2 and V_2_TURBO. // // Any of "V_1", "V_1_TURBO", "V_2", "V_2_TURBO", "V_2A", "V_2A_TURBO", "V_3". Model ModelEnum `json:"model,omitzero,required"` // The prompt used to describe the edited result. Prompt string `json:"prompt,required"` // The number of images to generate. NumImages param.Opt[int64] `json:"num_images,omitzero"` // Random seed. Set for reproducible generation. Seed param.Opt[int64] `json:"seed,omitzero"` // Determine if MagicPrompt should be used in generating the request or not. // // Any of "AUTO", "ON", "OFF". MagicPromptOption MagicPromptOption `json:"magic_prompt_option,omitzero"` // The style type to generate with; this is only applicable for models V_2 and // above and should not be specified for model versions V_1. // // Any of "AUTO", "GENERAL", "REALISTIC", "DESIGN", "RENDER_3D", "ANIME", "CUSTOM". StyleType StyleTypeV2AndAbove `json:"style_type,omitzero"` // contains filtered or unexported fields }
func (EditApplyParams) MarshalMultipart ¶
func (r EditApplyParams) MarshalMultipart() (data []byte, contentType string, err error)
type EditService ¶
type EditService struct {
Options []option.RequestOption
}
EditService contains methods and other services that help with interacting with the ideogram-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEditService method instead.
func NewEditService ¶
func NewEditService(opts ...option.RequestOption) (r EditService)
NewEditService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*EditService) Apply ¶
func (r *EditService) Apply(ctx context.Context, body EditApplyParams, opts ...option.RequestOption) (res *GenerateImage, err error)
Edit a given image synchronously using the provided mask. The mask indicates which part of the image should be edited, while the prompt and chosen style type can further guide the edit.
Supported image formats include JPEG, PNG, and WebP.
Images links are available for a limited period of time; if you would like to keep the image, you must download it.
type GenerateImage ¶
type GenerateImage struct { // The time the request was created. Created time.Time `json:"created,required" format:"date-time"` // A list of ImageObjects that contain the generated image(s). Data []GenerateImageData `json:"data,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Created respjson.Field Data respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
The response which contains information about the generated image, including the download link. Images links are available for a limited period of time; if you would like to keep the image, you must download it.
func (GenerateImage) RawJSON ¶
func (r GenerateImage) RawJSON() string
Returns the unmodified JSON received from the API
func (*GenerateImage) UnmarshalJSON ¶
func (r *GenerateImage) UnmarshalJSON(data []byte) error
type GenerateImageData ¶
type GenerateImageData struct { // Whether this request passes safety checks. If false, the url field will be // empty. IsImageSafe bool `json:"is_image_safe,required"` // The prompt used for the generation. This may be different from the original // prompt. Prompt string `json:"prompt,required"` // The resolution of the final image. Resolution string `json:"resolution,required"` // Random seed. Set for reproducible generation. Seed int64 `json:"seed,required"` // The style type to generate with; this is only applicable for models V_2 and // above and should not be specified for model versions V_1. // // Any of "AUTO", "GENERAL", "REALISTIC", "DESIGN", "RENDER_3D", "ANIME", "CUSTOM". StyleType StyleTypeV2AndAbove `json:"style_type"` // The direct link to the image generated. URL string `json:"url,nullable" format:"uri"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { IsImageSafe respjson.Field Prompt respjson.Field Resolution respjson.Field Seed respjson.Field StyleType respjson.Field URL respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (GenerateImageData) RawJSON ¶
func (r GenerateImageData) RawJSON() string
Returns the unmodified JSON received from the API
func (*GenerateImageData) UnmarshalJSON ¶
func (r *GenerateImageData) UnmarshalJSON(data []byte) error
type GenerateNewParams ¶
type GenerateNewParams struct { ImageRequest ImageRequestParam `json:"image_request,omitzero,required"` // contains filtered or unexported fields }
func (GenerateNewParams) MarshalJSON ¶
func (r GenerateNewParams) MarshalJSON() (data []byte, err error)
func (*GenerateNewParams) UnmarshalJSON ¶
func (r *GenerateNewParams) UnmarshalJSON(data []byte) error
type GenerateService ¶
type GenerateService struct {
Options []option.RequestOption
}
GenerateService contains methods and other services that help with interacting with the ideogram-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewGenerateService method instead.
func NewGenerateService ¶
func NewGenerateService(opts ...option.RequestOption) (r GenerateService)
NewGenerateService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*GenerateService) New ¶
func (r *GenerateService) New(ctx context.Context, body GenerateNewParams, opts ...option.RequestOption) (res *GenerateImage, err error)
Generates images synchronously based on a given prompt and optional parameters.
Images links are available for a limited period of time; if you would like to keep the image, you must download it.
type IdeogramV3EditParams ¶
type IdeogramV3EditParams struct { // The image being edited (max size 10MB); only JPEG, WebP and PNG formats are // supported at this time. Image io.Reader `json:"image,omitzero,required" format:"binary"` // A black and white image of the same size as the image being edited (max size // 10MB). Black regions in the mask should match up with the regions of the image // that you would like to edit; only JPEG, WebP and PNG formats are supported at // this time. Mask io.Reader `json:"mask,omitzero,required" format:"binary"` // The prompt used to describe the edited result. Prompt string `json:"prompt,required"` // The number of images to generate. NumImages param.Opt[int64] `json:"num_images,omitzero"` // Random seed. Set for reproducible generation. Seed param.Opt[int64] `json:"seed,omitzero"` // A color palette for generation, must EITHER be specified via one of the presets // (name) or explicitly via hexadecimal representations of the color with optional // weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. ColorPalette ColorPaletteUnionParam `json:"color_palette,omitzero"` // Determine if MagicPrompt should be used in generating the request or not. // // Any of "AUTO", "ON", "OFF". MagicPrompt MagicPromptOption `json:"magic_prompt,omitzero"` // The rendering speed to use. // // Any of "TURBO", "BALANCED", "DEFAULT", "QUALITY". RenderingSpeed RenderingSpeed `json:"rendering_speed,omitzero"` // A list of 8 character hexadecimal codes representing the style of the image. // Cannot be used in conjunction with style_reference_images or style_type. StyleCodes []string `json:"style_codes,omitzero"` // A set of images to use as style references (maximum total size 10MB across all // style references). The images should be in JPEG, PNG or WebP format. StyleReferenceImages []io.Reader `json:"style_reference_images,omitzero" format:"binary"` // contains filtered or unexported fields }
func (IdeogramV3EditParams) MarshalMultipart ¶
func (r IdeogramV3EditParams) MarshalMultipart() (data []byte, contentType string, err error)
type IdeogramV3GenerateParams ¶
type IdeogramV3GenerateParams struct { // The prompt to use to generate the image. Prompt string `json:"prompt,required"` // Description of what to exclude from an image. Descriptions in the prompt take // precedence to descriptions in the negative prompt. NegativePrompt param.Opt[string] `json:"negative_prompt,omitzero"` // Number of images to generate. NumImages param.Opt[int64] `json:"num_images,omitzero"` // Random seed. Set for reproducible generation. Seed param.Opt[int64] `json:"seed,omitzero"` // The aspect ratio to use for image generation, which determines the image's // resolution. Cannot be used in conjunction with resolution. Defaults to 1x1. // // Any of "1x3", "3x1", "1x2", "2x1", "9x16", "16x9", "10x16", "16x10", "2x3", // "3x2", "3x4", "4x3", "4x5", "5x4", "1x1". AspectRatio AspectRatio `json:"aspect_ratio,omitzero"` // A color palette for generation, must EITHER be specified via one of the presets // (name) or explicitly via hexadecimal representations of the color with optional // weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. ColorPalette ColorPaletteUnionParam `json:"color_palette,omitzero"` // Determine if MagicPrompt should be used in generating the request or not. // // Any of "AUTO", "ON", "OFF". MagicPrompt MagicPromptOption `json:"magic_prompt,omitzero"` // The rendering speed to use. // // Any of "TURBO", "BALANCED", "DEFAULT", "QUALITY". RenderingSpeed RenderingSpeed `json:"rendering_speed,omitzero"` // The resolutions supported for Ideogram 3.0. // // Any of "512x1536", "576x1408", "576x1472", "576x1536", "640x1344", "640x1408", // "640x1472", "640x1536", "704x1152", "704x1216", "704x1280", "704x1344", // "704x1408", "704x1472", "736x1312", "768x1088", "768x1216", "768x1280", // "768x1344", "800x1280", "832x960", "832x1024", "832x1088", "832x1152", // "832x1216", "832x1248", "864x1152", "896x960", "896x1024", "896x1088", // "896x1120", "896x1152", "960x832", "960x896", "960x1024", "960x1088", // "1024x832", "1024x896", "1024x960", "1024x1024", "1088x768", "1088x832", // "1088x896", "1088x960", "1120x896", "1152x704", "1152x832", "1152x864", // "1152x896", "1216x704", "1216x768", "1216x832", "1248x832", "1280x704", // "1280x768", "1280x800", "1312x736", "1344x640", "1344x704", "1344x768", // "1408x576", "1408x640", "1408x704", "1472x576", "1472x640", "1472x704", // "1536x512", "1536x576", "1536x640". Resolution ResolutionIdeogram `json:"resolution,omitzero"` // A list of 8 character hexadecimal codes representing the style of the image. // Cannot be used in conjunction with style_reference_images or style_type. StyleCodes []string `json:"style_codes,omitzero"` // A set of images to use as style references (maximum total size 10MB across all // style references). The images should be in JPEG, PNG or WebP format. StyleReferenceImages []io.Reader `json:"style_reference_images,omitzero" format:"binary"` // The style type to generate with. // // Any of "AUTO", "GENERAL", "REALISTIC", "DESIGN". StyleType StyleTypeV3 `json:"style_type,omitzero"` // contains filtered or unexported fields }
func (IdeogramV3GenerateParams) MarshalMultipart ¶
func (r IdeogramV3GenerateParams) MarshalMultipart() (data []byte, contentType string, err error)
type IdeogramV3ReframeParams ¶
type IdeogramV3ReframeParams struct { // The image being reframed (max size 10MB); only JPEG, WebP and PNG formats are // supported at this time. Image io.Reader `json:"image,omitzero,required" format:"binary"` // The resolutions supported for Ideogram 3.0. // // Any of "512x1536", "576x1408", "576x1472", "576x1536", "640x1344", "640x1408", // "640x1472", "640x1536", "704x1152", "704x1216", "704x1280", "704x1344", // "704x1408", "704x1472", "736x1312", "768x1088", "768x1216", "768x1280", // "768x1344", "800x1280", "832x960", "832x1024", "832x1088", "832x1152", // "832x1216", "832x1248", "864x1152", "896x960", "896x1024", "896x1088", // "896x1120", "896x1152", "960x832", "960x896", "960x1024", "960x1088", // "1024x832", "1024x896", "1024x960", "1024x1024", "1088x768", "1088x832", // "1088x896", "1088x960", "1120x896", "1152x704", "1152x832", "1152x864", // "1152x896", "1216x704", "1216x768", "1216x832", "1248x832", "1280x704", // "1280x768", "1280x800", "1312x736", "1344x640", "1344x704", "1344x768", // "1408x576", "1408x640", "1408x704", "1472x576", "1472x640", "1472x704", // "1536x512", "1536x576", "1536x640". Resolution ResolutionIdeogram `json:"resolution,omitzero,required"` // The number of images to generate. NumImages param.Opt[int64] `json:"num_images,omitzero"` // Random seed. Set for reproducible generation. Seed param.Opt[int64] `json:"seed,omitzero"` // A color palette for generation, must EITHER be specified via one of the presets // (name) or explicitly via hexadecimal representations of the color with optional // weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. ColorPalette ColorPaletteUnionParam `json:"color_palette,omitzero"` // The rendering speed to use. // // Any of "TURBO", "BALANCED", "DEFAULT", "QUALITY". RenderingSpeed RenderingSpeed `json:"rendering_speed,omitzero"` // A list of 8 character hexadecimal codes representing the style of the image. // Cannot be used in conjunction with style_reference_images or style_type. StyleCodes []string `json:"style_codes,omitzero"` // A set of images to use as style references (maximum total size 10MB across all // style references). The images should be in JPEG, PNG or WebP format. StyleReferenceImages []io.Reader `json:"style_reference_images,omitzero" format:"binary"` // contains filtered or unexported fields }
func (IdeogramV3ReframeParams) MarshalMultipart ¶
func (r IdeogramV3ReframeParams) MarshalMultipart() (data []byte, contentType string, err error)
type IdeogramV3RemixParams ¶
type IdeogramV3RemixParams struct { // The image to remix binary (max size 10MB); only JPEG, WebP and PNG formats are // supported at this time. Image io.Reader `json:"image,omitzero,required" format:"binary"` // The prompt to use to generate the image. Prompt string `json:"prompt,required"` ImageWeight param.Opt[int64] `json:"image_weight,omitzero"` // Description of what to exclude from an image. Descriptions in the prompt take // precedence to descriptions in the negative prompt. NegativePrompt param.Opt[string] `json:"negative_prompt,omitzero"` // Number of images to generate. NumImages param.Opt[int64] `json:"num_images,omitzero"` // Random seed. Set for reproducible generation. Seed param.Opt[int64] `json:"seed,omitzero"` // The aspect ratio to use for image generation, which determines the image's // resolution. Cannot be used in conjunction with resolution. Defaults to 1x1. // // Any of "1x3", "3x1", "1x2", "2x1", "9x16", "16x9", "10x16", "16x10", "2x3", // "3x2", "3x4", "4x3", "4x5", "5x4", "1x1". AspectRatio AspectRatio `json:"aspect_ratio,omitzero"` // A color palette for generation, must EITHER be specified via one of the presets // (name) or explicitly via hexadecimal representations of the color with optional // weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. ColorPalette ColorPaletteUnionParam `json:"color_palette,omitzero"` // Determine if MagicPrompt should be used in generating the request or not. // // Any of "AUTO", "ON", "OFF". MagicPrompt MagicPromptOption `json:"magic_prompt,omitzero"` // The rendering speed to use. // // Any of "TURBO", "BALANCED", "DEFAULT", "QUALITY". RenderingSpeed RenderingSpeed `json:"rendering_speed,omitzero"` // The resolutions supported for Ideogram 3.0. // // Any of "512x1536", "576x1408", "576x1472", "576x1536", "640x1344", "640x1408", // "640x1472", "640x1536", "704x1152", "704x1216", "704x1280", "704x1344", // "704x1408", "704x1472", "736x1312", "768x1088", "768x1216", "768x1280", // "768x1344", "800x1280", "832x960", "832x1024", "832x1088", "832x1152", // "832x1216", "832x1248", "864x1152", "896x960", "896x1024", "896x1088", // "896x1120", "896x1152", "960x832", "960x896", "960x1024", "960x1088", // "1024x832", "1024x896", "1024x960", "1024x1024", "1088x768", "1088x832", // "1088x896", "1088x960", "1120x896", "1152x704", "1152x832", "1152x864", // "1152x896", "1216x704", "1216x768", "1216x832", "1248x832", "1280x704", // "1280x768", "1280x800", "1312x736", "1344x640", "1344x704", "1344x768", // "1408x576", "1408x640", "1408x704", "1472x576", "1472x640", "1472x704", // "1536x512", "1536x576", "1536x640". Resolution ResolutionIdeogram `json:"resolution,omitzero"` // A list of 8 character hexadecimal codes representing the style of the image. // Cannot be used in conjunction with style_reference_images or style_type. StyleCodes []string `json:"style_codes,omitzero"` // A set of images to use as style references (maximum total size 10MB across all // style references). The images should be in JPEG, PNG or WebP format. StyleReferenceImages []io.Reader `json:"style_reference_images,omitzero" format:"binary"` // The style type to generate with. // // Any of "AUTO", "GENERAL", "REALISTIC", "DESIGN". StyleType StyleTypeV3 `json:"style_type,omitzero"` // contains filtered or unexported fields }
func (IdeogramV3RemixParams) MarshalMultipart ¶
func (r IdeogramV3RemixParams) MarshalMultipart() (data []byte, contentType string, err error)
type IdeogramV3ReplaceBackgroundParams ¶
type IdeogramV3ReplaceBackgroundParams struct { // The image whose background is being replaced (max size 10MB); only JPEG, WebP // and PNG formats are supported at this time. Image io.Reader `json:"image,omitzero,required" format:"binary"` // The prompt describing the desired new background. Prompt string `json:"prompt,required"` // The number of images to generate. NumImages param.Opt[int64] `json:"num_images,omitzero"` // Random seed. Set for reproducible generation. Seed param.Opt[int64] `json:"seed,omitzero"` // A color palette for generation, must EITHER be specified via one of the presets // (name) or explicitly via hexadecimal representations of the color with optional // weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. ColorPalette ColorPaletteUnionParam `json:"color_palette,omitzero"` // Determine if MagicPrompt should be used in generating the request or not. // // Any of "AUTO", "ON", "OFF". MagicPrompt MagicPromptOption `json:"magic_prompt,omitzero"` // The rendering speed to use. // // Any of "TURBO", "BALANCED", "DEFAULT", "QUALITY". RenderingSpeed RenderingSpeed `json:"rendering_speed,omitzero"` // A list of 8 character hexadecimal codes representing the style of the image. // Cannot be used in conjunction with style_reference_images or style_type. StyleCodes []string `json:"style_codes,omitzero"` // A set of images to use as style references (maximum total size 10MB across all // style references). The images should be in JPEG, PNG or WebP format. StyleReferenceImages []io.Reader `json:"style_reference_images,omitzero" format:"binary"` // contains filtered or unexported fields }
func (IdeogramV3ReplaceBackgroundParams) MarshalMultipart ¶
func (r IdeogramV3ReplaceBackgroundParams) MarshalMultipart() (data []byte, contentType string, err error)
type IdeogramV3Service ¶
type IdeogramV3Service struct {
Options []option.RequestOption
}
IdeogramV3Service contains methods and other services that help with interacting with the ideogram-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewIdeogramV3Service method instead.
func NewIdeogramV3Service ¶
func NewIdeogramV3Service(opts ...option.RequestOption) (r IdeogramV3Service)
NewIdeogramV3Service generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*IdeogramV3Service) Edit ¶
func (r *IdeogramV3Service) Edit(ctx context.Context, body IdeogramV3EditParams, opts ...option.RequestOption) (res *ImageGenerationResponse, err error)
Edit a given image synchronously using the provided mask with Ideogram 3.0. The mask indicates which part of the image should be edited, while the prompt and chosen style can further guide the edit.
Supported image formats include JPEG, PNG, and WebP.
Images links are available for a limited period of time; if you would like to keep the image, you must download it.
func (*IdeogramV3Service) Generate ¶
func (r *IdeogramV3Service) Generate(ctx context.Context, body IdeogramV3GenerateParams, opts ...option.RequestOption) (res *ImageGenerationResponse, err error)
Generates images synchronously based on a given prompt and optional parameters using the Ideogram 3.0 model.
Images links are available for a limited period of time; if you would like to keep the image, you must download it.
func (*IdeogramV3Service) Reframe ¶
func (r *IdeogramV3Service) Reframe(ctx context.Context, body IdeogramV3ReframeParams, opts ...option.RequestOption) (res *ImageGenerationResponse, err error)
Reframe a square image to a chosen resolution with Ideogram 3.0. The supported image formats include JPEG, PNG, and WebP.
Image links are available for a limited period of time; if you would like to keep the image, you must download it.
func (*IdeogramV3Service) Remix ¶
func (r *IdeogramV3Service) Remix(ctx context.Context, body IdeogramV3RemixParams, opts ...option.RequestOption) (res *ImageGenerationResponse, err error)
Remix provided images synchronously based on a given prompt and optional parameters with the Ideogram 3.0 model.
Input images are cropped to the chosen aspect ratio before being remixed.
Supported image formats include JPEG, PNG, and WebP.
Images links are available for a limited period of time; if you would like to keep the image, you must download it.
func (*IdeogramV3Service) ReplaceBackground ¶
func (r *IdeogramV3Service) ReplaceBackground(ctx context.Context, body IdeogramV3ReplaceBackgroundParams, opts ...option.RequestOption) (res *ImageGenerationResponse, err error)
Replace the background of a given image synchronously using a prompt with Ideogram 3.0. The foreground subject will be identified and kept, while the background is replaced based on the prompt and chosen style. Supported image formats include JPEG, PNG, and WebP. Images links are available for a limited period of time; if you would like to keep the image, you must download it.
type ImageGenerationResponse ¶
type ImageGenerationResponse struct { // The time the request was created. Created time.Time `json:"created,required" format:"date-time"` // A list of ImageObjects that contain the generated image(s). Data []ImageGenerationResponseData `json:"data,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Created respjson.Field Data respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
The response which contains information about the generated image, including the download link. Images links are available for a limited period of time; if you would like to keep the image, you must download it.
func (ImageGenerationResponse) RawJSON ¶
func (r ImageGenerationResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ImageGenerationResponse) UnmarshalJSON ¶
func (r *ImageGenerationResponse) UnmarshalJSON(data []byte) error
type ImageGenerationResponseData ¶
type ImageGenerationResponseData struct { // Whether this request passes safety checks. If false, the url field will be // empty. IsImageSafe bool `json:"is_image_safe,required"` // The prompt used for the generation. This may be different from the original // prompt. Prompt string `json:"prompt,required"` // The resolutions supported for Ideogram 3.0. // // Any of "512x1536", "576x1408", "576x1472", "576x1536", "640x1344", "640x1408", // "640x1472", "640x1536", "704x1152", "704x1216", "704x1280", "704x1344", // "704x1408", "704x1472", "736x1312", "768x1088", "768x1216", "768x1280", // "768x1344", "800x1280", "832x960", "832x1024", "832x1088", "832x1152", // "832x1216", "832x1248", "864x1152", "896x960", "896x1024", "896x1088", // "896x1120", "896x1152", "960x832", "960x896", "960x1024", "960x1088", // "1024x832", "1024x896", "1024x960", "1024x1024", "1088x768", "1088x832", // "1088x896", "1088x960", "1120x896", "1152x704", "1152x832", "1152x864", // "1152x896", "1216x704", "1216x768", "1216x832", "1248x832", "1280x704", // "1280x768", "1280x800", "1312x736", "1344x640", "1344x704", "1344x768", // "1408x576", "1408x640", "1408x704", "1472x576", "1472x640", "1472x704", // "1536x512", "1536x576", "1536x640". Resolution ResolutionIdeogram `json:"resolution,required"` // Random seed. Set for reproducible generation. Seed int64 `json:"seed,required"` // The style type to generate with. // // Any of "AUTO", "GENERAL", "REALISTIC", "DESIGN". StyleType StyleTypeV3 `json:"style_type"` // The direct link to the image generated. URL string `json:"url,nullable" format:"uri"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { IsImageSafe respjson.Field Prompt respjson.Field Resolution respjson.Field Seed respjson.Field StyleType respjson.Field URL respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (ImageGenerationResponseData) RawJSON ¶
func (r ImageGenerationResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*ImageGenerationResponseData) UnmarshalJSON ¶
func (r *ImageGenerationResponseData) UnmarshalJSON(data []byte) error
type ImageRequestAspectRatio ¶
type ImageRequestAspectRatio string
(Cannot be used in conjunction with resolution) The aspect ratio to use for image generation, which determines the image's resolution. Defaults to ASPECT_1_1.
const ( ImageRequestAspectRatioAspect10_16 ImageRequestAspectRatio = "ASPECT_10_16" ImageRequestAspectRatioAspect16_10 ImageRequestAspectRatio = "ASPECT_16_10" ImageRequestAspectRatioAspect9_16 ImageRequestAspectRatio = "ASPECT_9_16" ImageRequestAspectRatioAspect16_9 ImageRequestAspectRatio = "ASPECT_16_9" ImageRequestAspectRatioAspect3_2 ImageRequestAspectRatio = "ASPECT_3_2" ImageRequestAspectRatioAspect2_3 ImageRequestAspectRatio = "ASPECT_2_3" ImageRequestAspectRatioAspect4_3 ImageRequestAspectRatio = "ASPECT_4_3" ImageRequestAspectRatioAspect3_4 ImageRequestAspectRatio = "ASPECT_3_4" ImageRequestAspectRatioAspect1_1 ImageRequestAspectRatio = "ASPECT_1_1" ImageRequestAspectRatioAspect1_3 ImageRequestAspectRatio = "ASPECT_1_3" ImageRequestAspectRatioAspect3_1 ImageRequestAspectRatio = "ASPECT_3_1" )
type ImageRequestParam ¶
type ImageRequestParam struct { // The prompt to use to generate the image. Prompt string `json:"prompt,required"` // Only available for model versions V_1, V_1_TURBO, V_2 and V_2_TURBO. Description // of what to exclude from an image. Descriptions in the prompt take precedence to // descriptions in the negative prompt. NegativePrompt param.Opt[string] `json:"negative_prompt,omitzero"` // The number of images to generate. NumImages param.Opt[int64] `json:"num_images,omitzero"` // Random seed. Set for reproducible generation. Seed param.Opt[int64] `json:"seed,omitzero"` // (Cannot be used in conjunction with resolution) The aspect ratio to use for // image generation, which determines the image's resolution. Defaults to // ASPECT_1_1. // // Any of "ASPECT_10_16", "ASPECT_16_10", "ASPECT_9_16", "ASPECT_16_9", // "ASPECT_3_2", "ASPECT_2_3", "ASPECT_4_3", "ASPECT_3_4", "ASPECT_1_1", // "ASPECT_1_3", "ASPECT_3_1". AspectRatio ImageRequestAspectRatio `json:"aspect_ratio,omitzero"` // A color palette for generation, must EITHER be specified via one of the presets // (name) or explicitly via hexadecimal representations of the color with optional // weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models. ColorPalette ColorPaletteUnionParam `json:"color_palette,omitzero"` // Determine if MagicPrompt should be used in generating the request or not. // // Any of "AUTO", "ON", "OFF". MagicPromptOption MagicPromptOption `json:"magic_prompt_option,omitzero"` // The magic prompt version to use when magic prompt option is set to AUTO or ON. // // Any of "V_0", "V_0_1", "V_0_2". MagicPromptVersion MagicPromptVersionEnum `json:"magic_prompt_version,omitzero"` // The model used to generate an image or edit one. /generate and /remix supports // all model types, however, /edit is only supported for V_2 and V_2_TURBO. // // Any of "V_1", "V_1_TURBO", "V_2", "V_2_TURBO", "V_2A", "V_2A_TURBO", "V_3". Model ModelEnum `json:"model,omitzero"` // (For model_version for 2.0 only, cannot be used in conjunction with // aspect_ratio) The resolution to use for image generation, represented in width x // height. If not specified, defaults to using aspect_ratio. // // Any of "RESOLUTION_512_1536", "RESOLUTION_576_1408", "RESOLUTION_576_1472", // "RESOLUTION_576_1536", "RESOLUTION_640_1024", "RESOLUTION_640_1344", // "RESOLUTION_640_1408", "RESOLUTION_640_1472", "RESOLUTION_640_1536", // "RESOLUTION_704_1152", "RESOLUTION_704_1216", "RESOLUTION_704_1280", // "RESOLUTION_704_1344", "RESOLUTION_704_1408", "RESOLUTION_704_1472", // "RESOLUTION_720_1280", "RESOLUTION_736_1312", "RESOLUTION_768_1024", // "RESOLUTION_768_1088", "RESOLUTION_768_1152", "RESOLUTION_768_1216", // "RESOLUTION_768_1232", "RESOLUTION_768_1280", "RESOLUTION_768_1344", // "RESOLUTION_832_960", "RESOLUTION_832_1024", "RESOLUTION_832_1088", // "RESOLUTION_832_1152", "RESOLUTION_832_1216", "RESOLUTION_832_1248", // "RESOLUTION_864_1152", "RESOLUTION_896_960", "RESOLUTION_896_1024", // "RESOLUTION_896_1088", "RESOLUTION_896_1120", "RESOLUTION_896_1152", // "RESOLUTION_960_832", "RESOLUTION_960_896", "RESOLUTION_960_1024", // "RESOLUTION_960_1088", "RESOLUTION_1024_640", "RESOLUTION_1024_768", // "RESOLUTION_1024_832", "RESOLUTION_1024_896", "RESOLUTION_1024_960", // "RESOLUTION_1024_1024", "RESOLUTION_1088_768", "RESOLUTION_1088_832", // "RESOLUTION_1088_896", "RESOLUTION_1088_960", "RESOLUTION_1120_896", // "RESOLUTION_1152_704", "RESOLUTION_1152_768", "RESOLUTION_1152_832", // "RESOLUTION_1152_864", "RESOLUTION_1152_896", "RESOLUTION_1216_704", // "RESOLUTION_1216_768", "RESOLUTION_1216_832", "RESOLUTION_1232_768", // "RESOLUTION_1248_832", "RESOLUTION_1280_704", "RESOLUTION_1280_720", // "RESOLUTION_1280_768", "RESOLUTION_1280_800", "RESOLUTION_1312_736", // "RESOLUTION_1344_640", "RESOLUTION_1344_704", "RESOLUTION_1344_768", // "RESOLUTION_1408_576", "RESOLUTION_1408_640", "RESOLUTION_1408_704", // "RESOLUTION_1472_576", "RESOLUTION_1472_640", "RESOLUTION_1472_704", // "RESOLUTION_1536_512", "RESOLUTION_1536_576", "RESOLUTION_1536_640". Resolution ResolutionImageGeneration `json:"resolution,omitzero"` // The style type to generate with; this is only applicable for models V_2 and // above and should not be specified for model versions V_1. // // Any of "AUTO", "GENERAL", "REALISTIC", "DESIGN", "RENDER_3D", "ANIME", "CUSTOM". StyleType StyleTypeV2AndAbove `json:"style_type,omitzero"` // contains filtered or unexported fields }
The property Prompt is required.
func (ImageRequestParam) MarshalJSON ¶
func (r ImageRequestParam) MarshalJSON() (data []byte, err error)
func (*ImageRequestParam) UnmarshalJSON ¶
func (r *ImageRequestParam) UnmarshalJSON(data []byte) error
type InternalTestingNewParams ¶
type InternalTestingNewParams struct { RequiredDateTypeField time.Time `json:"required_date_type_field,required" format:"date"` XPosition param.Opt[int64] `json:"x_position,omitzero"` DateTimeTypeField param.Opt[time.Time] `json:"date_time_type_field,omitzero" format:"date-time"` DateTypeField param.Opt[time.Time] `json:"date_type_field,omitzero" format:"date"` SomeText param.Opt[string] `json:"some_text,omitzero"` XTestHeader param.Opt[string] `header:"X-Test-Header,omitzero" json:"-"` XTestHeader2 param.Opt[string] `header:"X-Test-Header-2,omitzero" json:"-"` // An image binary (max size 10MB); only JPEG, WebP and PNG formats are supported // at this time. AnotherImageFile io.Reader `json:"another_image_file,omitzero" format:"binary"` // Any of "EIN", "ZWEI", "DREI". EnumTypeField InternalTestingNewParamsEnumTypeField `json:"enum_type_field,omitzero"` // An image binary (max size 10MB); only JPEG, WebP and PNG formats are supported // at this time. ImageFile io.Reader `json:"image_file,omitzero" format:"binary"` NestedObject NestedObjectParam `json:"nested_object,omitzero"` NestedObjectRequiredFields InternalTestingNewParamsNestedObjectRequiredFields `json:"nested_object_required_fields,omitzero"` RepeatedComplexField []NestedObjectParam `json:"repeated_complex_field,omitzero"` RepeatedPrimitiveField []string `json:"repeated_primitive_field,omitzero"` // contains filtered or unexported fields }
func (InternalTestingNewParams) MarshalMultipart ¶
func (r InternalTestingNewParams) MarshalMultipart() (data []byte, contentType string, err error)
type InternalTestingNewParamsEnumTypeField ¶
type InternalTestingNewParamsEnumTypeField string
const ( InternalTestingNewParamsEnumTypeFieldEin InternalTestingNewParamsEnumTypeField = "EIN" InternalTestingNewParamsEnumTypeFieldZwei InternalTestingNewParamsEnumTypeField = "ZWEI" InternalTestingNewParamsEnumTypeFieldDrei InternalTestingNewParamsEnumTypeField = "DREI" )
type InternalTestingNewParamsNestedObjectRequiredFields ¶
type InternalTestingNewParamsNestedObjectRequiredFields struct { PropOne string `json:"prop_one,required"` PropTwo string `json:"prop_two,required"` // contains filtered or unexported fields }
The properties PropOne, PropTwo are required.
func (InternalTestingNewParamsNestedObjectRequiredFields) MarshalJSON ¶
func (r InternalTestingNewParamsNestedObjectRequiredFields) MarshalJSON() (data []byte, err error)
func (*InternalTestingNewParamsNestedObjectRequiredFields) UnmarshalJSON ¶
func (r *InternalTestingNewParamsNestedObjectRequiredFields) UnmarshalJSON(data []byte) error
type InternalTestingNewResponse ¶
type InternalTestingNewResponse struct { ResponseContent string `json:"response_content"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ResponseContent respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (InternalTestingNewResponse) RawJSON ¶
func (r InternalTestingNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*InternalTestingNewResponse) UnmarshalJSON ¶
func (r *InternalTestingNewResponse) UnmarshalJSON(data []byte) error
type InternalTestingService ¶
type InternalTestingService struct {
Options []option.RequestOption
}
InternalTestingService contains methods and other services that help with interacting with the ideogram-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewInternalTestingService method instead.
func NewInternalTestingService ¶
func NewInternalTestingService(opts ...option.RequestOption) (r InternalTestingService)
NewInternalTestingService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*InternalTestingService) New ¶
func (r *InternalTestingService) New(ctx context.Context, params InternalTestingNewParams, opts ...option.RequestOption) (res *InternalTestingNewResponse, err error)
Just a testing endpoint
type MagicPromptOption ¶
type MagicPromptOption string
Determine if MagicPrompt should be used in generating the request or not.
const ( MagicPromptOptionAuto MagicPromptOption = "AUTO" MagicPromptOptionOn MagicPromptOption = "ON" MagicPromptOptionOff MagicPromptOption = "OFF" )
type MagicPromptVersionEnum ¶
type MagicPromptVersionEnum string
The magic prompt version to use when magic prompt option is set to AUTO or ON.
const ( MagicPromptVersionEnumV0 MagicPromptVersionEnum = "V_0" MagicPromptVersionEnumV0_1 MagicPromptVersionEnum = "V_0_1" MagicPromptVersionEnumV0_2 MagicPromptVersionEnum = "V_0_2" )
type ManageAPIAPIKeyService ¶
type ManageAPIAPIKeyService struct {
Options []option.RequestOption
}
ManageAPIAPIKeyService contains methods and other services that help with interacting with the ideogram-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewManageAPIAPIKeyService method instead.
func NewManageAPIAPIKeyService ¶
func NewManageAPIAPIKeyService(opts ...option.RequestOption) (r ManageAPIAPIKeyService)
NewManageAPIAPIKeyService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ManageAPIAPIKeyService) Delete ¶
func (r *ManageAPIAPIKeyService) Delete(ctx context.Context, apiKeyID string, opts ...option.RequestOption) (err error)
Delete an API key.
func (*ManageAPIAPIKeyService) Get ¶
func (r *ManageAPIAPIKeyService) Get(ctx context.Context, opts ...option.RequestOption) (res *ManageApiapiKeyGetResponse, err error)
Retrieve current API keys and their respective data.
func (*ManageAPIAPIKeyService) New ¶
func (r *ManageAPIAPIKeyService) New(ctx context.Context, opts ...option.RequestOption) (res *ManageApiapiKeyNewResponse, err error)
Creates an API key.
type ManageAPIAddCreditsParams ¶
type ManageAPIAddCreditsParams struct { // Represents a price. Amount PriceParam `json:"amount,omitzero,required"` // contains filtered or unexported fields }
func (ManageAPIAddCreditsParams) MarshalJSON ¶
func (r ManageAPIAddCreditsParams) MarshalJSON() (data []byte, err error)
func (*ManageAPIAddCreditsParams) UnmarshalJSON ¶
func (r *ManageAPIAddCreditsParams) UnmarshalJSON(data []byte) error
type ManageAPIAddCreditsResponse ¶
type ManageAPIAddCreditsResponse struct { // Represents a price. Amount Price `json:"amount,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Amount respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (ManageAPIAddCreditsResponse) RawJSON ¶
func (r ManageAPIAddCreditsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ManageAPIAddCreditsResponse) UnmarshalJSON ¶
func (r *ManageAPIAddCreditsResponse) UnmarshalJSON(data []byte) error
type ManageAPIGetStripeSubscriptionParams ¶
type ManageAPIGetStripeSubscriptionParams struct { // Whether the subscription is intended to be used for business or personal use. IsBusiness param.Opt[bool] `query:"isBusiness,omitzero" json:"-"` // contains filtered or unexported fields }
func (ManageAPIGetStripeSubscriptionParams) URLQuery ¶
func (r ManageAPIGetStripeSubscriptionParams) URLQuery() (v url.Values, err error)
URLQuery serializes ManageAPIGetStripeSubscriptionParams's query parameters as `url.Values`.
type ManageAPIGetStripeSubscriptionResponse ¶
type ManageAPIGetStripeSubscriptionResponse struct { // DEPRECATED. The URL for the user to manage the existing Stripe subscription // plan. Get this from ManageApiSubscriptionResponse instead. // // Deprecated: deprecated StripeBillingURL string `json:"stripe_billing_url"` // The URL for the user to checkout the Stripe subscription plan. StripeSubscriptionURL string `json:"stripe_subscription_url"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { StripeBillingURL respjson.Field StripeSubscriptionURL respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (ManageAPIGetStripeSubscriptionResponse) RawJSON ¶
func (r ManageAPIGetStripeSubscriptionResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ManageAPIGetStripeSubscriptionResponse) UnmarshalJSON ¶
func (r *ManageAPIGetStripeSubscriptionResponse) UnmarshalJSON(data []byte) error
type ManageAPIReactivateResponse ¶
type ManageAPIReactivateResponse struct { // The current recharge settings for the API subscription. RechargeSettings RechargeSettingsResponse `json:"recharge_settings"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { RechargeSettings respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Response to re-activating API settings.
func (ManageAPIReactivateResponse) RawJSON ¶
func (r ManageAPIReactivateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ManageAPIReactivateResponse) UnmarshalJSON ¶
func (r *ManageAPIReactivateResponse) UnmarshalJSON(data []byte) error
type ManageAPIService ¶
type ManageAPIService struct { Options []option.RequestOption APIKeys ManageAPIAPIKeyService Subscription ManageAPISubscriptionService Terms ManageAPITermService }
ManageAPIService contains methods and other services that help with interacting with the ideogram-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewManageAPIService method instead.
func NewManageAPIService ¶
func NewManageAPIService(opts ...option.RequestOption) (r ManageAPIService)
NewManageAPIService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ManageAPIService) AddCredits ¶
func (r *ManageAPIService) AddCredits(ctx context.Context, body ManageAPIAddCreditsParams, opts ...option.RequestOption) (res *ManageAPIAddCreditsResponse, err error)
Add credits to an API user's account.
func (*ManageAPIService) GetStripeSubscription ¶
func (r *ManageAPIService) GetStripeSubscription(ctx context.Context, query ManageAPIGetStripeSubscriptionParams, opts ...option.RequestOption) (res *ManageAPIGetStripeSubscriptionResponse, err error)
Retrieve data relevant to connecting to Stripe.
func (*ManageAPIService) Reactivate ¶
func (r *ManageAPIService) Reactivate(ctx context.Context, opts ...option.RequestOption) (res *ManageAPIReactivateResponse, err error)
Reactivates a subscription by attempting to re-enable Metronome billing.
type ManageAPISubscriptionGetResponse ¶
type ManageAPISubscriptionGetResponse struct { // Whether or not the latest required terms have been accepted. HasAcceptedTerms bool `json:"has_accepted_terms,required"` // Whether or not Stripe is setup for API usage. HasStripeSetup bool `json:"has_stripe_setup,required"` // The URL to display the customer usage dashboard, in dark mode. // // Deprecated: deprecated MetronomeDashboardDarkModeURL string `json:"metronome_dashboard_dark_mode_url"` // The URL to display the customer usage dashboard. // // Deprecated: deprecated MetronomeDashboardURL string `json:"metronome_dashboard_url"` MetronomeLinks ManageAPISubscriptionGetResponseMetronomeLinks `json:"metronome_links"` // The current recharge settings for the API subscription. RechargeSettings RechargeSettingsResponse `json:"recharge_settings"` // The URL for the user to manage the existing Stripe subscription plan. StripeBillingURL string `json:"stripe_billing_url"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { HasAcceptedTerms respjson.Field HasStripeSetup respjson.Field MetronomeDashboardDarkModeURL respjson.Field MetronomeDashboardURL respjson.Field MetronomeLinks respjson.Field RechargeSettings respjson.Field StripeBillingURL respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (ManageAPISubscriptionGetResponse) RawJSON ¶
func (r ManageAPISubscriptionGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ManageAPISubscriptionGetResponse) UnmarshalJSON ¶
func (r *ManageAPISubscriptionGetResponse) UnmarshalJSON(data []byte) error
type ManageAPISubscriptionGetResponseMetronomeLinks ¶
type ManageAPISubscriptionGetResponseMetronomeLinks struct { // The URL to display the customer invoice and API usage. CreditsIframeDarkModeURL string `json:"credits_iframe_dark_mode_url"` // The URL to display the customer invoice and API usage. CreditsIframeURL string `json:"credits_iframe_url"` // The URL to display the customer invoice and API usage. InvoicesIframeDarkModeURL string `json:"invoices_iframe_dark_mode_url"` // The URL to display the customer invoice and API usage. InvoicesIframeURL string `json:"invoices_iframe_url"` // The URL to display the customer usage dashboard, in dark mode. UsageIframeDarkModeURL string `json:"usage_iframe_dark_mode_url"` // The URL to display the customer usage dashboard. UsageIframeURL string `json:"usage_iframe_url"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { CreditsIframeDarkModeURL respjson.Field CreditsIframeURL respjson.Field InvoicesIframeDarkModeURL respjson.Field InvoicesIframeURL respjson.Field UsageIframeDarkModeURL respjson.Field UsageIframeURL respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (ManageAPISubscriptionGetResponseMetronomeLinks) RawJSON ¶
func (r ManageAPISubscriptionGetResponseMetronomeLinks) RawJSON() string
Returns the unmodified JSON received from the API
func (*ManageAPISubscriptionGetResponseMetronomeLinks) UnmarshalJSON ¶
func (r *ManageAPISubscriptionGetResponseMetronomeLinks) UnmarshalJSON(data []byte) error
type ManageAPISubscriptionService ¶
type ManageAPISubscriptionService struct {
Options []option.RequestOption
}
ManageAPISubscriptionService contains methods and other services that help with interacting with the ideogram-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewManageAPISubscriptionService method instead.
func NewManageAPISubscriptionService ¶
func NewManageAPISubscriptionService(opts ...option.RequestOption) (r ManageAPISubscriptionService)
NewManageAPISubscriptionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ManageAPISubscriptionService) Get ¶
func (r *ManageAPISubscriptionService) Get(ctx context.Context, opts ...option.RequestOption) (res *ManageAPISubscriptionGetResponse, err error)
Retrieve data relevant to creating an API subscription.
func (*ManageAPISubscriptionService) Update ¶
func (r *ManageAPISubscriptionService) Update(ctx context.Context, body ManageAPISubscriptionUpdateParams, opts ...option.RequestOption) (res *ManageAPISubscriptionUpdateResponse, err error)
Update API subscription settings
type ManageAPISubscriptionUpdateParams ¶
type ManageAPISubscriptionUpdateParams struct { // The current recharge settings for the API subscription. RechargeSettings RechargeSettingsSubscriptionParam `json:"recharge_settings,omitzero"` // contains filtered or unexported fields }
func (ManageAPISubscriptionUpdateParams) MarshalJSON ¶
func (r ManageAPISubscriptionUpdateParams) MarshalJSON() (data []byte, err error)
func (*ManageAPISubscriptionUpdateParams) UnmarshalJSON ¶
func (r *ManageAPISubscriptionUpdateParams) UnmarshalJSON(data []byte) error
type ManageAPISubscriptionUpdateResponse ¶
type ManageAPISubscriptionUpdateResponse struct { // The current recharge settings for the API subscription. RechargeSettings RechargeSettingsResponse `json:"recharge_settings"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { RechargeSettings respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
The updated API subscription.
func (ManageAPISubscriptionUpdateResponse) RawJSON ¶
func (r ManageAPISubscriptionUpdateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ManageAPISubscriptionUpdateResponse) UnmarshalJSON ¶
func (r *ManageAPISubscriptionUpdateResponse) UnmarshalJSON(data []byte) error
type ManageAPITermAcceptParams ¶
type ManageAPITermAcceptParams struct { // The ID of the terms which are being accepted. TermsID string `json:"terms_id,required"` // contains filtered or unexported fields }
func (ManageAPITermAcceptParams) MarshalJSON ¶
func (r ManageAPITermAcceptParams) MarshalJSON() (data []byte, err error)
func (*ManageAPITermAcceptParams) UnmarshalJSON ¶
func (r *ManageAPITermAcceptParams) UnmarshalJSON(data []byte) error
type ManageAPITermGetResponse ¶
type ManageAPITermGetResponse struct { APITerms ManageAPITermGetResponseAPITerms `json:"api_terms,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { APITerms respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (ManageAPITermGetResponse) RawJSON ¶
func (r ManageAPITermGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ManageAPITermGetResponse) UnmarshalJSON ¶
func (r *ManageAPITermGetResponse) UnmarshalJSON(data []byte) error
type ManageAPITermGetResponseAPITerms ¶
type ManageAPITermGetResponseAPITerms struct { // The ID of the terms. TermsID string `json:"terms_id,required"` // The URL where the terms are hosted. TermsURL string `json:"terms_url,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { TermsID respjson.Field TermsURL respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (ManageAPITermGetResponseAPITerms) RawJSON ¶
func (r ManageAPITermGetResponseAPITerms) RawJSON() string
Returns the unmodified JSON received from the API
func (*ManageAPITermGetResponseAPITerms) UnmarshalJSON ¶
func (r *ManageAPITermGetResponseAPITerms) UnmarshalJSON(data []byte) error
type ManageAPITermService ¶
type ManageAPITermService struct {
Options []option.RequestOption
}
ManageAPITermService contains methods and other services that help with interacting with the ideogram-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewManageAPITermService method instead.
func NewManageAPITermService ¶
func NewManageAPITermService(opts ...option.RequestOption) (r ManageAPITermService)
NewManageAPITermService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ManageAPITermService) Accept ¶
func (r *ManageAPITermService) Accept(ctx context.Context, body ManageAPITermAcceptParams, opts ...option.RequestOption) (err error)
Accept terms
func (*ManageAPITermService) Get ¶
func (r *ManageAPITermService) Get(ctx context.Context, opts ...option.RequestOption) (res *ManageAPITermGetResponse, err error)
Retrieve the latest terms of service for API usage.
type ManageApiapiKeyGetResponse ¶
type ManageApiapiKeyGetResponse struct { // The current API keys that are active. Only returns redacted keys. CurrentAPIKeys []ManageApiapiKeyGetResponseCurrentAPIKey `json:"current_api_keys"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { CurrentAPIKeys respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (ManageApiapiKeyGetResponse) RawJSON ¶
func (r ManageApiapiKeyGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ManageApiapiKeyGetResponse) UnmarshalJSON ¶
func (r *ManageApiapiKeyGetResponse) UnmarshalJSON(data []byte) error
type ManageApiapiKeyGetResponseCurrentAPIKey ¶
type ManageApiapiKeyGetResponseCurrentAPIKey struct { // A URL safe base64 encoded UUID APIKeyID string `json:"api_key_id,required"` // The time at which the key was created CreationTime time.Time `json:"creation_time,required" format:"date-time"` // A redacted text snippet of the API key. Contains the first 4 characters of the // API key RedactedAPIKey string `json:"redacted_api_key,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { APIKeyID respjson.Field CreationTime respjson.Field RedactedAPIKey respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
A representation of an API key that does not contain the full key.
func (ManageApiapiKeyGetResponseCurrentAPIKey) RawJSON ¶
func (r ManageApiapiKeyGetResponseCurrentAPIKey) RawJSON() string
Returns the unmodified JSON received from the API
func (*ManageApiapiKeyGetResponseCurrentAPIKey) UnmarshalJSON ¶
func (r *ManageApiapiKeyGetResponseCurrentAPIKey) UnmarshalJSON(data []byte) error
type ManageApiapiKeyNewResponse ¶
type ManageApiapiKeyNewResponse struct { // The API key to use when making authenticated requests with the API. This key // will only be shown once. APIKey string `json:"api_key,required"` // The ID of the API key. A URL safe base64 encoded UUID APIKeyID string `json:"api_key_id,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { APIKey respjson.Field APIKeyID respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (ManageApiapiKeyNewResponse) RawJSON ¶
func (r ManageApiapiKeyNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ManageApiapiKeyNewResponse) UnmarshalJSON ¶
func (r *ManageApiapiKeyNewResponse) UnmarshalJSON(data []byte) error
type ManageService ¶
type ManageService struct { Options []option.RequestOption API ManageAPIService }
ManageService contains methods and other services that help with interacting with the ideogram-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewManageService method instead.
func NewManageService ¶
func NewManageService(opts ...option.RequestOption) (r ManageService)
NewManageService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
type ModelEnum ¶
type ModelEnum string
The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.
type NestedObjectParam ¶
type NestedObjectParam struct { PropOne param.Opt[string] `json:"prop_one,omitzero"` PropTwo param.Opt[string] `json:"prop_two,omitzero"` // contains filtered or unexported fields }
func (NestedObjectParam) MarshalJSON ¶
func (r NestedObjectParam) MarshalJSON() (data []byte, err error)
func (*NestedObjectParam) UnmarshalJSON ¶
func (r *NestedObjectParam) UnmarshalJSON(data []byte) error
type Price ¶
type Price struct { // The amount of the currency in the common denomination. For example, in USD this // is cents. Amount float64 `json:"amount,required"` // The ISO 4217 currency code for the price object. CurrencyCode string `json:"currency_code,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Amount respjson.Field CurrencyCode respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Represents a price.
func (Price) ToParam ¶
func (r Price) ToParam() PriceParam
ToParam converts this Price to a PriceParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with PriceParam.Overrides()
func (*Price) UnmarshalJSON ¶
type PriceParam ¶
type PriceParam struct { // The amount of the currency in the common denomination. For example, in USD this // is cents. Amount float64 `json:"amount,required"` // The ISO 4217 currency code for the price object. CurrencyCode string `json:"currency_code,required"` // contains filtered or unexported fields }
Represents a price.
The properties Amount, CurrencyCode are required.
func (PriceParam) MarshalJSON ¶
func (r PriceParam) MarshalJSON() (data []byte, err error)
func (*PriceParam) UnmarshalJSON ¶
func (r *PriceParam) UnmarshalJSON(data []byte) error
type RechargeSettingsResponse ¶
type RechargeSettingsResponse struct { // Whether or not the recharge setting is currently active. IsActive bool `json:"is_active,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { IsActive respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` RechargeSettingsSubscription }
The current recharge settings for the API subscription.
func (RechargeSettingsResponse) RawJSON ¶
func (r RechargeSettingsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*RechargeSettingsResponse) UnmarshalJSON ¶
func (r *RechargeSettingsResponse) UnmarshalJSON(data []byte) error
type RechargeSettingsSubscription ¶
type RechargeSettingsSubscription struct { // Represents a price. MinimumBalanceThreshold Price `json:"minimum_balance_threshold,required"` // Represents a price. TopUpBalance Price `json:"top_up_balance,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { MinimumBalanceThreshold respjson.Field TopUpBalance respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
The current recharge settings for the API subscription.
func (RechargeSettingsSubscription) RawJSON ¶
func (r RechargeSettingsSubscription) RawJSON() string
Returns the unmodified JSON received from the API
func (RechargeSettingsSubscription) ToParam ¶
func (r RechargeSettingsSubscription) ToParam() RechargeSettingsSubscriptionParam
ToParam converts this RechargeSettingsSubscription to a RechargeSettingsSubscriptionParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with RechargeSettingsSubscriptionParam.Overrides()
func (*RechargeSettingsSubscription) UnmarshalJSON ¶
func (r *RechargeSettingsSubscription) UnmarshalJSON(data []byte) error
type RechargeSettingsSubscriptionParam ¶
type RechargeSettingsSubscriptionParam struct { // Represents a price. MinimumBalanceThreshold PriceParam `json:"minimum_balance_threshold,omitzero,required"` // Represents a price. TopUpBalance PriceParam `json:"top_up_balance,omitzero,required"` // contains filtered or unexported fields }
The current recharge settings for the API subscription.
The properties MinimumBalanceThreshold, TopUpBalance are required.
func (RechargeSettingsSubscriptionParam) MarshalJSON ¶
func (r RechargeSettingsSubscriptionParam) MarshalJSON() (data []byte, err error)
func (*RechargeSettingsSubscriptionParam) UnmarshalJSON ¶
func (r *RechargeSettingsSubscriptionParam) UnmarshalJSON(data []byte) error
type ReframeNewParams ¶
type ReframeNewParams struct { // The image being reframed (max size 10MB); only JPEG, WebP and PNG formats are // supported at this time. ImageFile io.Reader `json:"image_file,omitzero,required" format:"binary"` // The model used to generate an image or edit one. /generate and /remix supports // all model types, however, /edit is only supported for V_2 and V_2_TURBO. // // Any of "V_1", "V_1_TURBO", "V_2", "V_2_TURBO", "V_2A", "V_2A_TURBO", "V_3". Model ModelEnum `json:"model,omitzero,required"` // (For model_version for 2.0 only, cannot be used in conjunction with // aspect_ratio) The resolution to use for image generation, represented in width x // height. If not specified, defaults to using aspect_ratio. // // Any of "RESOLUTION_512_1536", "RESOLUTION_576_1408", "RESOLUTION_576_1472", // "RESOLUTION_576_1536", "RESOLUTION_640_1024", "RESOLUTION_640_1344", // "RESOLUTION_640_1408", "RESOLUTION_640_1472", "RESOLUTION_640_1536", // "RESOLUTION_704_1152", "RESOLUTION_704_1216", "RESOLUTION_704_1280", // "RESOLUTION_704_1344", "RESOLUTION_704_1408", "RESOLUTION_704_1472", // "RESOLUTION_720_1280", "RESOLUTION_736_1312", "RESOLUTION_768_1024", // "RESOLUTION_768_1088", "RESOLUTION_768_1152", "RESOLUTION_768_1216", // "RESOLUTION_768_1232", "RESOLUTION_768_1280", "RESOLUTION_768_1344", // "RESOLUTION_832_960", "RESOLUTION_832_1024", "RESOLUTION_832_1088", // "RESOLUTION_832_1152", "RESOLUTION_832_1216", "RESOLUTION_832_1248", // "RESOLUTION_864_1152", "RESOLUTION_896_960", "RESOLUTION_896_1024", // "RESOLUTION_896_1088", "RESOLUTION_896_1120", "RESOLUTION_896_1152", // "RESOLUTION_960_832", "RESOLUTION_960_896", "RESOLUTION_960_1024", // "RESOLUTION_960_1088", "RESOLUTION_1024_640", "RESOLUTION_1024_768", // "RESOLUTION_1024_832", "RESOLUTION_1024_896", "RESOLUTION_1024_960", // "RESOLUTION_1024_1024", "RESOLUTION_1088_768", "RESOLUTION_1088_832", // "RESOLUTION_1088_896", "RESOLUTION_1088_960", "RESOLUTION_1120_896", // "RESOLUTION_1152_704", "RESOLUTION_1152_768", "RESOLUTION_1152_832", // "RESOLUTION_1152_864", "RESOLUTION_1152_896", "RESOLUTION_1216_704", // "RESOLUTION_1216_768", "RESOLUTION_1216_832", "RESOLUTION_1232_768", // "RESOLUTION_1248_832", "RESOLUTION_1280_704", "RESOLUTION_1280_720", // "RESOLUTION_1280_768", "RESOLUTION_1280_800", "RESOLUTION_1312_736", // "RESOLUTION_1344_640", "RESOLUTION_1344_704", "RESOLUTION_1344_768", // "RESOLUTION_1408_576", "RESOLUTION_1408_640", "RESOLUTION_1408_704", // "RESOLUTION_1472_576", "RESOLUTION_1472_640", "RESOLUTION_1472_704", // "RESOLUTION_1536_512", "RESOLUTION_1536_576", "RESOLUTION_1536_640". Resolution ResolutionImageGeneration `json:"resolution,omitzero,required"` // The number of images to generate. NumImages param.Opt[int64] `json:"num_images,omitzero"` // Random seed. Set for reproducible generation. Seed param.Opt[int64] `json:"seed,omitzero"` // The style type to generate with; this is only applicable for models V_2 and // above and should not be specified for model versions V_1. // // Any of "AUTO", "GENERAL", "REALISTIC", "DESIGN", "RENDER_3D", "ANIME", "CUSTOM". StyleType StyleTypeV2AndAbove `json:"style_type,omitzero"` // contains filtered or unexported fields }
func (ReframeNewParams) MarshalMultipart ¶
func (r ReframeNewParams) MarshalMultipart() (data []byte, contentType string, err error)
type ReframeService ¶
type ReframeService struct {
Options []option.RequestOption
}
ReframeService contains methods and other services that help with interacting with the ideogram-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewReframeService method instead.
func NewReframeService ¶
func NewReframeService(opts ...option.RequestOption) (r ReframeService)
NewReframeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ReframeService) New ¶
func (r *ReframeService) New(ctx context.Context, body ReframeNewParams, opts ...option.RequestOption) (res *GenerateImage, err error)
Reframe a square image to a chosen resolution. The supported image formats include JPEG, PNG, and WebP.
Image links are available for a limited period of time; if you would like to keep the image, you must download it.
type RemixNewParams ¶
type RemixNewParams struct { // An image binary (max size 10MB); only JPEG, WebP and PNG formats are supported // at this time. ImageFile io.Reader `json:"image_file,omitzero,required" format:"binary"` // A request to generate a new image using a provided image and a prompt. ImageRequest RemixNewParamsImageRequest `json:"image_request,omitzero,required"` // contains filtered or unexported fields }
func (RemixNewParams) MarshalMultipart ¶
func (r RemixNewParams) MarshalMultipart() (data []byte, contentType string, err error)
type RemixNewParamsImageRequest ¶
type RemixNewParamsImageRequest struct { ImageWeight param.Opt[int64] `json:"image_weight,omitzero"` ImageRequestParam }
A request to generate a new image using a provided image and a prompt.
func (RemixNewParamsImageRequest) MarshalJSON ¶
func (r RemixNewParamsImageRequest) MarshalJSON() (data []byte, err error)
type RemixService ¶
type RemixService struct {
Options []option.RequestOption
}
RemixService contains methods and other services that help with interacting with the ideogram-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewRemixService method instead.
func NewRemixService ¶
func NewRemixService(opts ...option.RequestOption) (r RemixService)
NewRemixService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*RemixService) New ¶
func (r *RemixService) New(ctx context.Context, body RemixNewParams, opts ...option.RequestOption) (res *GenerateImage, err error)
Remix provided images synchronously based on a given prompt and optional parameters.
Input images are cropped to the chosen aspect ratio before being remixed.
Supported image formats include JPEG, PNG, and WebP.
Images links are available for a limited period of time; if you would like to keep the image, you must download it.
type RenderingSpeed ¶
type RenderingSpeed string
The rendering speed to use.
const ( RenderingSpeedTurbo RenderingSpeed = "TURBO" RenderingSpeedBalanced RenderingSpeed = "BALANCED" RenderingSpeedDefault RenderingSpeed = "DEFAULT" RenderingSpeedQuality RenderingSpeed = "QUALITY" )
type ResolutionIdeogram ¶
type ResolutionIdeogram string
The resolutions supported for Ideogram 3.0.
const ( ResolutionIdeogram512x1536 ResolutionIdeogram = "512x1536" ResolutionIdeogram576x1408 ResolutionIdeogram = "576x1408" ResolutionIdeogram576x1472 ResolutionIdeogram = "576x1472" ResolutionIdeogram576x1536 ResolutionIdeogram = "576x1536" ResolutionIdeogram640x1344 ResolutionIdeogram = "640x1344" ResolutionIdeogram640x1408 ResolutionIdeogram = "640x1408" ResolutionIdeogram640x1472 ResolutionIdeogram = "640x1472" ResolutionIdeogram640x1536 ResolutionIdeogram = "640x1536" ResolutionIdeogram704x1152 ResolutionIdeogram = "704x1152" ResolutionIdeogram704x1216 ResolutionIdeogram = "704x1216" ResolutionIdeogram704x1280 ResolutionIdeogram = "704x1280" ResolutionIdeogram704x1344 ResolutionIdeogram = "704x1344" ResolutionIdeogram704x1408 ResolutionIdeogram = "704x1408" ResolutionIdeogram704x1472 ResolutionIdeogram = "704x1472" ResolutionIdeogram736x1312 ResolutionIdeogram = "736x1312" ResolutionIdeogram768x1088 ResolutionIdeogram = "768x1088" ResolutionIdeogram768x1216 ResolutionIdeogram = "768x1216" ResolutionIdeogram768x1280 ResolutionIdeogram = "768x1280" ResolutionIdeogram768x1344 ResolutionIdeogram = "768x1344" ResolutionIdeogram800x1280 ResolutionIdeogram = "800x1280" ResolutionIdeogram832x960 ResolutionIdeogram = "832x960" ResolutionIdeogram832x1024 ResolutionIdeogram = "832x1024" ResolutionIdeogram832x1088 ResolutionIdeogram = "832x1088" ResolutionIdeogram832x1152 ResolutionIdeogram = "832x1152" ResolutionIdeogram832x1216 ResolutionIdeogram = "832x1216" ResolutionIdeogram832x1248 ResolutionIdeogram = "832x1248" ResolutionIdeogram864x1152 ResolutionIdeogram = "864x1152" ResolutionIdeogram896x960 ResolutionIdeogram = "896x960" ResolutionIdeogram896x1024 ResolutionIdeogram = "896x1024" ResolutionIdeogram896x1088 ResolutionIdeogram = "896x1088" ResolutionIdeogram896x1120 ResolutionIdeogram = "896x1120" ResolutionIdeogram896x1152 ResolutionIdeogram = "896x1152" ResolutionIdeogram960x832 ResolutionIdeogram = "960x832" ResolutionIdeogram960x896 ResolutionIdeogram = "960x896" ResolutionIdeogram960x1024 ResolutionIdeogram = "960x1024" ResolutionIdeogram960x1088 ResolutionIdeogram = "960x1088" ResolutionIdeogram1024x832 ResolutionIdeogram = "1024x832" ResolutionIdeogram1024x896 ResolutionIdeogram = "1024x896" ResolutionIdeogram1024x960 ResolutionIdeogram = "1024x960" ResolutionIdeogram1024x1024 ResolutionIdeogram = "1024x1024" ResolutionIdeogram1088x768 ResolutionIdeogram = "1088x768" ResolutionIdeogram1088x832 ResolutionIdeogram = "1088x832" ResolutionIdeogram1088x896 ResolutionIdeogram = "1088x896" ResolutionIdeogram1088x960 ResolutionIdeogram = "1088x960" ResolutionIdeogram1120x896 ResolutionIdeogram = "1120x896" ResolutionIdeogram1152x704 ResolutionIdeogram = "1152x704" ResolutionIdeogram1152x832 ResolutionIdeogram = "1152x832" ResolutionIdeogram1152x864 ResolutionIdeogram = "1152x864" ResolutionIdeogram1152x896 ResolutionIdeogram = "1152x896" ResolutionIdeogram1216x704 ResolutionIdeogram = "1216x704" ResolutionIdeogram1216x768 ResolutionIdeogram = "1216x768" ResolutionIdeogram1216x832 ResolutionIdeogram = "1216x832" ResolutionIdeogram1248x832 ResolutionIdeogram = "1248x832" ResolutionIdeogram1280x704 ResolutionIdeogram = "1280x704" ResolutionIdeogram1280x768 ResolutionIdeogram = "1280x768" ResolutionIdeogram1280x800 ResolutionIdeogram = "1280x800" ResolutionIdeogram1312x736 ResolutionIdeogram = "1312x736" ResolutionIdeogram1344x640 ResolutionIdeogram = "1344x640" ResolutionIdeogram1344x704 ResolutionIdeogram = "1344x704" ResolutionIdeogram1344x768 ResolutionIdeogram = "1344x768" ResolutionIdeogram1408x576 ResolutionIdeogram = "1408x576" ResolutionIdeogram1408x640 ResolutionIdeogram = "1408x640" ResolutionIdeogram1408x704 ResolutionIdeogram = "1408x704" ResolutionIdeogram1472x576 ResolutionIdeogram = "1472x576" ResolutionIdeogram1472x640 ResolutionIdeogram = "1472x640" ResolutionIdeogram1472x704 ResolutionIdeogram = "1472x704" ResolutionIdeogram1536x512 ResolutionIdeogram = "1536x512" ResolutionIdeogram1536x576 ResolutionIdeogram = "1536x576" ResolutionIdeogram1536x640 ResolutionIdeogram = "1536x640" )
type ResolutionImageGeneration ¶
type ResolutionImageGeneration string
(For model_version for 2.0 only, cannot be used in conjunction with aspect_ratio) The resolution to use for image generation, represented in width x height. If not specified, defaults to using aspect_ratio.
const ( ResolutionImageGenerationResolution512_1536 ResolutionImageGeneration = "RESOLUTION_512_1536" ResolutionImageGenerationResolution576_1408 ResolutionImageGeneration = "RESOLUTION_576_1408" ResolutionImageGenerationResolution576_1472 ResolutionImageGeneration = "RESOLUTION_576_1472" ResolutionImageGenerationResolution576_1536 ResolutionImageGeneration = "RESOLUTION_576_1536" ResolutionImageGenerationResolution640_1024 ResolutionImageGeneration = "RESOLUTION_640_1024" ResolutionImageGenerationResolution640_1344 ResolutionImageGeneration = "RESOLUTION_640_1344" ResolutionImageGenerationResolution640_1408 ResolutionImageGeneration = "RESOLUTION_640_1408" ResolutionImageGenerationResolution640_1472 ResolutionImageGeneration = "RESOLUTION_640_1472" ResolutionImageGenerationResolution640_1536 ResolutionImageGeneration = "RESOLUTION_640_1536" ResolutionImageGenerationResolution704_1152 ResolutionImageGeneration = "RESOLUTION_704_1152" ResolutionImageGenerationResolution704_1216 ResolutionImageGeneration = "RESOLUTION_704_1216" ResolutionImageGenerationResolution704_1280 ResolutionImageGeneration = "RESOLUTION_704_1280" ResolutionImageGenerationResolution704_1344 ResolutionImageGeneration = "RESOLUTION_704_1344" ResolutionImageGenerationResolution704_1408 ResolutionImageGeneration = "RESOLUTION_704_1408" ResolutionImageGenerationResolution704_1472 ResolutionImageGeneration = "RESOLUTION_704_1472" ResolutionImageGenerationResolution720_1280 ResolutionImageGeneration = "RESOLUTION_720_1280" ResolutionImageGenerationResolution736_1312 ResolutionImageGeneration = "RESOLUTION_736_1312" ResolutionImageGenerationResolution768_1024 ResolutionImageGeneration = "RESOLUTION_768_1024" ResolutionImageGenerationResolution768_1088 ResolutionImageGeneration = "RESOLUTION_768_1088" ResolutionImageGenerationResolution768_1152 ResolutionImageGeneration = "RESOLUTION_768_1152" ResolutionImageGenerationResolution768_1216 ResolutionImageGeneration = "RESOLUTION_768_1216" ResolutionImageGenerationResolution768_1232 ResolutionImageGeneration = "RESOLUTION_768_1232" ResolutionImageGenerationResolution768_1280 ResolutionImageGeneration = "RESOLUTION_768_1280" ResolutionImageGenerationResolution768_1344 ResolutionImageGeneration = "RESOLUTION_768_1344" ResolutionImageGenerationResolution832_960 ResolutionImageGeneration = "RESOLUTION_832_960" ResolutionImageGenerationResolution832_1024 ResolutionImageGeneration = "RESOLUTION_832_1024" ResolutionImageGenerationResolution832_1088 ResolutionImageGeneration = "RESOLUTION_832_1088" ResolutionImageGenerationResolution832_1152 ResolutionImageGeneration = "RESOLUTION_832_1152" ResolutionImageGenerationResolution832_1216 ResolutionImageGeneration = "RESOLUTION_832_1216" ResolutionImageGenerationResolution832_1248 ResolutionImageGeneration = "RESOLUTION_832_1248" ResolutionImageGenerationResolution864_1152 ResolutionImageGeneration = "RESOLUTION_864_1152" ResolutionImageGenerationResolution896_960 ResolutionImageGeneration = "RESOLUTION_896_960" ResolutionImageGenerationResolution896_1024 ResolutionImageGeneration = "RESOLUTION_896_1024" ResolutionImageGenerationResolution896_1088 ResolutionImageGeneration = "RESOLUTION_896_1088" ResolutionImageGenerationResolution896_1120 ResolutionImageGeneration = "RESOLUTION_896_1120" ResolutionImageGenerationResolution896_1152 ResolutionImageGeneration = "RESOLUTION_896_1152" ResolutionImageGenerationResolution960_832 ResolutionImageGeneration = "RESOLUTION_960_832" ResolutionImageGenerationResolution960_896 ResolutionImageGeneration = "RESOLUTION_960_896" ResolutionImageGenerationResolution960_1024 ResolutionImageGeneration = "RESOLUTION_960_1024" ResolutionImageGenerationResolution960_1088 ResolutionImageGeneration = "RESOLUTION_960_1088" ResolutionImageGenerationResolution1024_640 ResolutionImageGeneration = "RESOLUTION_1024_640" ResolutionImageGenerationResolution1024_768 ResolutionImageGeneration = "RESOLUTION_1024_768" ResolutionImageGenerationResolution1024_832 ResolutionImageGeneration = "RESOLUTION_1024_832" ResolutionImageGenerationResolution1024_896 ResolutionImageGeneration = "RESOLUTION_1024_896" ResolutionImageGenerationResolution1024_960 ResolutionImageGeneration = "RESOLUTION_1024_960" ResolutionImageGenerationResolution1024_1024 ResolutionImageGeneration = "RESOLUTION_1024_1024" ResolutionImageGenerationResolution1088_768 ResolutionImageGeneration = "RESOLUTION_1088_768" ResolutionImageGenerationResolution1088_832 ResolutionImageGeneration = "RESOLUTION_1088_832" ResolutionImageGenerationResolution1088_896 ResolutionImageGeneration = "RESOLUTION_1088_896" ResolutionImageGenerationResolution1088_960 ResolutionImageGeneration = "RESOLUTION_1088_960" ResolutionImageGenerationResolution1120_896 ResolutionImageGeneration = "RESOLUTION_1120_896" ResolutionImageGenerationResolution1152_704 ResolutionImageGeneration = "RESOLUTION_1152_704" ResolutionImageGenerationResolution1152_768 ResolutionImageGeneration = "RESOLUTION_1152_768" ResolutionImageGenerationResolution1152_832 ResolutionImageGeneration = "RESOLUTION_1152_832" ResolutionImageGenerationResolution1152_864 ResolutionImageGeneration = "RESOLUTION_1152_864" ResolutionImageGenerationResolution1152_896 ResolutionImageGeneration = "RESOLUTION_1152_896" ResolutionImageGenerationResolution1216_704 ResolutionImageGeneration = "RESOLUTION_1216_704" ResolutionImageGenerationResolution1216_768 ResolutionImageGeneration = "RESOLUTION_1216_768" ResolutionImageGenerationResolution1216_832 ResolutionImageGeneration = "RESOLUTION_1216_832" ResolutionImageGenerationResolution1232_768 ResolutionImageGeneration = "RESOLUTION_1232_768" ResolutionImageGenerationResolution1248_832 ResolutionImageGeneration = "RESOLUTION_1248_832" ResolutionImageGenerationResolution1280_704 ResolutionImageGeneration = "RESOLUTION_1280_704" ResolutionImageGenerationResolution1280_720 ResolutionImageGeneration = "RESOLUTION_1280_720" ResolutionImageGenerationResolution1280_768 ResolutionImageGeneration = "RESOLUTION_1280_768" ResolutionImageGenerationResolution1280_800 ResolutionImageGeneration = "RESOLUTION_1280_800" ResolutionImageGenerationResolution1312_736 ResolutionImageGeneration = "RESOLUTION_1312_736" ResolutionImageGenerationResolution1344_640 ResolutionImageGeneration = "RESOLUTION_1344_640" ResolutionImageGenerationResolution1344_704 ResolutionImageGeneration = "RESOLUTION_1344_704" ResolutionImageGenerationResolution1344_768 ResolutionImageGeneration = "RESOLUTION_1344_768" ResolutionImageGenerationResolution1408_576 ResolutionImageGeneration = "RESOLUTION_1408_576" ResolutionImageGenerationResolution1408_640 ResolutionImageGeneration = "RESOLUTION_1408_640" ResolutionImageGenerationResolution1408_704 ResolutionImageGeneration = "RESOLUTION_1408_704" ResolutionImageGenerationResolution1472_576 ResolutionImageGeneration = "RESOLUTION_1472_576" ResolutionImageGenerationResolution1472_640 ResolutionImageGeneration = "RESOLUTION_1472_640" ResolutionImageGenerationResolution1472_704 ResolutionImageGeneration = "RESOLUTION_1472_704" ResolutionImageGenerationResolution1536_512 ResolutionImageGeneration = "RESOLUTION_1536_512" ResolutionImageGenerationResolution1536_576 ResolutionImageGeneration = "RESOLUTION_1536_576" ResolutionImageGenerationResolution1536_640 ResolutionImageGeneration = "RESOLUTION_1536_640" )
type StyleTypeV2AndAbove ¶
type StyleTypeV2AndAbove string
The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.
const ( StyleTypeV2AndAboveAuto StyleTypeV2AndAbove = "AUTO" StyleTypeV2AndAboveGeneral StyleTypeV2AndAbove = "GENERAL" StyleTypeV2AndAboveRealistic StyleTypeV2AndAbove = "REALISTIC" StyleTypeV2AndAboveDesign StyleTypeV2AndAbove = "DESIGN" StyleTypeV2AndAboveRender3D StyleTypeV2AndAbove = "RENDER_3D" StyleTypeV2AndAboveAnime StyleTypeV2AndAbove = "ANIME" StyleTypeV2AndAboveCustom StyleTypeV2AndAbove = "CUSTOM" )
type StyleTypeV3 ¶
type StyleTypeV3 string
The style type to generate with.
const ( StyleTypeV3Auto StyleTypeV3 = "AUTO" StyleTypeV3General StyleTypeV3 = "GENERAL" StyleTypeV3Realistic StyleTypeV3 = "REALISTIC" StyleTypeV3Design StyleTypeV3 = "DESIGN" )
type UpscaleNewParams ¶
type UpscaleNewParams struct { // An image binary (max size 10MB); only JPEG, WebP and PNG formats are supported // at this time. ImageFile io.Reader `json:"image_file,omitzero,required" format:"binary"` // A request to upscale a provided image with the help of an optional prompt. ImageRequest UpscaleNewParamsImageRequest `json:"image_request,omitzero,required"` // contains filtered or unexported fields }
func (UpscaleNewParams) MarshalMultipart ¶
func (r UpscaleNewParams) MarshalMultipart() (data []byte, contentType string, err error)
type UpscaleNewParamsImageRequest ¶
type UpscaleNewParamsImageRequest struct { Detail param.Opt[int64] `json:"detail,omitzero"` // The number of images to generate. NumImages param.Opt[int64] `json:"num_images,omitzero"` // An optional prompt to guide the upscale Prompt param.Opt[string] `json:"prompt,omitzero"` Resemblance param.Opt[int64] `json:"resemblance,omitzero"` // Random seed. Set for reproducible generation. Seed param.Opt[int64] `json:"seed,omitzero"` // Determine if MagicPrompt should be used in generating the request or not. // // Any of "AUTO", "ON", "OFF". MagicPromptOption MagicPromptOption `json:"magic_prompt_option,omitzero"` // The magic prompt version to use when magic prompt option is set to AUTO or ON. // // Any of "V_0", "V_0_1", "V_0_2". MagicPromptVersion MagicPromptVersionEnum `json:"magic_prompt_version,omitzero"` // contains filtered or unexported fields }
A request to upscale a provided image with the help of an optional prompt.
func (UpscaleNewParamsImageRequest) MarshalJSON ¶
func (r UpscaleNewParamsImageRequest) MarshalJSON() (data []byte, err error)
func (*UpscaleNewParamsImageRequest) UnmarshalJSON ¶
func (r *UpscaleNewParamsImageRequest) UnmarshalJSON(data []byte) error
type UpscaleService ¶
type UpscaleService struct {
Options []option.RequestOption
}
UpscaleService contains methods and other services that help with interacting with the ideogram-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewUpscaleService method instead.
func NewUpscaleService ¶
func NewUpscaleService(opts ...option.RequestOption) (r UpscaleService)
NewUpscaleService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*UpscaleService) New ¶
func (r *UpscaleService) New(ctx context.Context, body UpscaleNewParams, opts ...option.RequestOption) (res *GenerateImage, err error)
Upscale provided images synchronously with an optional prompt.
Supported image formats include JPEG, PNG, and WebP.
Images links are available for a limited period of time; if you would like to keep the image, you must download it.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
|
Package json implements encoding and decoding of JSON as defined in RFC 7159. |
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.21, and used by the Go 1.24 encoding/json package.
|
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.21, and used by the Go 1.24 encoding/json package. |
packages
|
|
shared
|
|