Documentation
¶
Overview ¶
Package tripo3d is the official Go SDK for the Tripo3D v3 API (https://developers.tripo3d.ai/en/docs/introduction) — an AI 3D generation platform covering text-to-3D, image-to-3D, multiview-to-3D, re-texturing, mesh editing, auto-rigging, and animation retargeting.
Global API base URL: https://openapi.tripo3d.ai/v3 China API base URL: https://openapi.tripo3d.com/v3
client, err := tripo3d.NewClient(tripo3d.ClientOptions{}) // reads TRIPO_API_KEY
taskID, err := client.TextToModel(ctx, tripo3d.TextToModelParams{Prompt: "a cute cat"})
task, err := client.WaitForTask(ctx, taskID, tripo3d.WaitOptions{})
fmt.Println(task.PrimaryModelURL())
Index ¶
- Constants
- func Bool(v bool) *bool
- func Float64(v float64) *float64
- func Int64(v int64) *int64
- func String(v string) *string
- type APIError
- type AnimOutFormat
- type Animation
- type Balance
- type Client
- func (c *Client) CompleteMesh(ctx context.Context, params CompleteMeshParams) (string, error)
- func (c *Client) ConvertModel(ctx context.Context, params ConvertModelParams) (string, error)
- func (c *Client) DecimateMesh(ctx context.Context, params DecimateMeshParams) (string, error)
- func (c *Client) DownloadModel(ctx context.Context, task *Task) (*DownloadedModel, error)
- func (c *Client) EditMultiview(ctx context.Context, params EditMultiviewParams) (string, error)
- func (c *Client) GetBalance(ctx context.Context) (*Balance, error)
- func (c *Client) GetTask(ctx context.Context, taskID string) (*Task, error)
- func (c *Client) ImageToImage(ctx context.Context, params ImageToImageParams) (string, error)
- func (c *Client) ImageToModel(ctx context.Context, params ImageToModelParams) (string, error)
- func (c *Client) ImageToMultiview(ctx context.Context, params ImageToMultiviewParams) (string, error)
- func (c *Client) ListTasks(ctx context.Context, taskIDs []string) ([]Task, error)
- func (c *Client) MultiviewToModel(ctx context.Context, params MultiviewToModelParams) (string, error)
- func (c *Client) RetargetAnimation(ctx context.Context, params RetargetAnimationParams) (string, error)
- func (c *Client) RigCheck(ctx context.Context, params RigCheckParams) (string, error)
- func (c *Client) RigModel(ctx context.Context, params RigModelParams) (string, error)
- func (c *Client) SegmentMesh(ctx context.Context, params SegmentMeshParams) (string, error)
- func (c *Client) TextToImage(ctx context.Context, params TextToImageParams) (string, error)
- func (c *Client) TextToModel(ctx context.Context, params TextToModelParams) (string, error)
- func (c *Client) TextureModel(ctx context.Context, params TextureModelParams) (string, error)
- func (c *Client) UploadFile(ctx context.Context, data []byte, filename, contentType string) (*UploadedFile, error)
- func (c *Client) WaitForTask(ctx context.Context, taskID string, opts WaitOptions) (*Task, error)
- type ClientOptions
- type CompleteMeshParams
- type ConvertModelParams
- type DecimateMeshParams
- type DownloadedModel
- type EditMultiviewParams
- type FileDescriptor
- type ImageToImageParams
- type ImageToModelParams
- type ImageToMultiviewParams
- type MultiviewToModelParams
- type ObjectRef
- type OutputFormat
- type RequestError
- type RetargetAnimationParams
- type RigCheckParams
- type RigModelParams
- type RigSpec
- type RigType
- type SegmentMeshParams
- type Task
- type TaskError
- type TaskOutput
- type TaskStatus
- type TextToImageParams
- type TextToModelParams
- type TextureFormat
- type TextureModelParams
- type TimeoutError
- type UploadedFile
- type WaitOptions
Constants ¶
const ( ModelVersionH31 = "v3.1-20260211" ModelVersionH30 = "v3.0-20250812" ModelVersionH25 = "v2.5-20250123" ModelVersionH20 = "v2.0-20240919" ModelVersionP1 = "P1-20260311" ModelVersionTurboV1 = "Turbo-v1.0-20250506" )
ModelVersion lists the `model` values (product lines) exposed by the v3 API. Kept as plain strings (not a closed type) since Tripo3D regularly ships new model versions.
const DefaultBaseURL = "https://openapi.tripo3d.com/v3"
DefaultBaseURL is the China mainland REST endpoint for the Tripo3D v3 openapi service. For overseas / global traffic use "https://openapi.tripo3d.ai/v3" via ClientOptions.BaseURL.
const SDKVersion = "0.1.0"
SDKVersion is the current tripo3d-sdk-go release version, also used as part of the default User-Agent header.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIError ¶
APIError is a well-formed `{ code, message, suggestion }` error envelope with a non-zero `code`, as returned by the Tripo3D API.
type AnimOutFormat ¶
type AnimOutFormat string
AnimOutFormat is the output format for rig / retarget tasks.
const ( AnimOutFormatGLB AnimOutFormat = "glb" AnimOutFormatFBX AnimOutFormat = "fbx" )
type Animation ¶
type Animation string
Animation is a preset animation identifier accepted by POST /v3/animations/retarget. Combine at most 5 in a single call.
const ( AnimationIdle Animation = "preset:idle" AnimationWalk Animation = "preset:walk" AnimationRun Animation = "preset:run" AnimationDive Animation = "preset:dive" AnimationClimb Animation = "preset:climb" AnimationJump Animation = "preset:jump" AnimationSlash Animation = "preset:slash" AnimationShoot Animation = "preset:shoot" AnimationHurt Animation = "preset:hurt" AnimationFall Animation = "preset:fall" AnimationTurn Animation = "preset:turn" AnimationQuadrupedWalk Animation = "preset:quadruped:walk" AnimationHexapodWalk Animation = "preset:hexapod:walk" AnimationOctopodWalk Animation = "preset:octopod:walk" AnimationSerpentineMarch Animation = "preset:serpentine:march" AnimationAquaticMarch Animation = "preset:aquatic:march" )
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the entry point for the Tripo3D v3 API.
func NewClient ¶
func NewClient(opts ClientOptions) (*Client, error)
NewClient builds a Client, reading TRIPO_API_KEY from the environment when opts.APIKey is empty.
func (*Client) CompleteMesh ¶
CompleteMesh calls POST /v3/mesh/complete (mesh completion / repair) and returns the resulting task_id.
func (*Client) ConvertModel ¶
ConvertModel calls POST /v3/models/convert (convert a completed model to another format) and returns the resulting task_id.
func (*Client) DecimateMesh ¶
DecimateMesh calls POST /v3/mesh/decimate (retopology / face-count reduction) and returns the resulting task_id.
func (*Client) DownloadModel ¶
DownloadModel fetches the primary model URL of a completed task. Returns (nil, nil) when the task has no model output.
func (*Client) EditMultiview ¶
EditMultiview calls POST /v3/generation/edit-multiview (refine a previously generated multiview set) and returns the resulting task_id.
func (*Client) GetBalance ¶
GetBalance calls GET /v3/account/balance.
func (*Client) ImageToImage ¶
ImageToImage calls POST /v3/generation/image-to-image (image style / edit transformation) and returns the resulting task_id.
func (*Client) ImageToModel ¶
ImageToModel calls POST /v3/generation/image-to-model and returns the resulting task_id.
func (*Client) ImageToMultiview ¶
func (c *Client) ImageToMultiview(ctx context.Context, params ImageToMultiviewParams) (string, error)
ImageToMultiview calls POST /v3/generation/image-to-multiview and returns the resulting task_id.
func (*Client) ListTasks ¶
ListTasks calls POST /v3/tasks/list to batch-query multiple tasks in one round trip.
func (*Client) MultiviewToModel ¶
func (c *Client) MultiviewToModel(ctx context.Context, params MultiviewToModelParams) (string, error)
MultiviewToModel calls POST /v3/generation/multiview-to-model and returns the resulting task_id.
func (*Client) RetargetAnimation ¶
func (c *Client) RetargetAnimation(ctx context.Context, params RetargetAnimationParams) (string, error)
RetargetAnimation calls POST /v3/animations/retarget (apply preset animations to a rigged model) and returns the resulting task_id.
func (*Client) RigCheck ¶
RigCheck calls POST /v3/animations/rig-check, which determines whether a generated model can be rigged and (if so) the recommended skeleton type. It returns the resulting task_id.
func (*Client) RigModel ¶
RigModel calls POST /v3/animations/rig (attach a skeleton to a model) and returns the resulting task_id.
func (*Client) SegmentMesh ¶
SegmentMesh calls POST /v3/mesh/segment (semantic segmentation of a mesh) and returns the resulting task_id.
func (*Client) TextToImage ¶
TextToImage calls POST /v3/generation/text-to-image and returns the resulting task_id.
func (*Client) TextToModel ¶
TextToModel calls POST /v3/generation/text-to-model and returns the resulting task_id.
func (*Client) TextureModel ¶
TextureModel calls POST /v3/models/texture (re-texture an existing model) and returns the resulting task_id.
func (*Client) UploadFile ¶
func (c *Client) UploadFile(ctx context.Context, data []byte, filename, contentType string) (*UploadedFile, error)
UploadFile calls POST /v3/files, uploading a raw file and returning its file_token.
func (*Client) WaitForTask ¶
WaitForTask polls GET /v3/tasks/{task_id} until the task reaches a terminal state, or the context is cancelled / opts.Timeout elapses.
By default, a non-"success" terminal status is surfaced as a *TaskError; set opts.IgnoreFailure to receive the task without an error instead.
type ClientOptions ¶
type ClientOptions struct {
// APIKey authenticates requests. Falls back to the TRIPO_API_KEY
// environment variable when empty.
APIKey string
// BaseURL overrides the API endpoint. Defaults to DefaultBaseURL.
BaseURL string
// HTTPClient overrides the underlying *http.Client. Defaults to
// http.DefaultClient's zero value (a fresh client with no timeout of
// its own — per-request timeouts are enforced via Timeout instead).
HTTPClient *http.Client
// Timeout bounds each individual HTTP request (not the whole
// WaitForTask polling loop). Defaults to 60s.
Timeout time.Duration
// Retries is the number of extra attempts made on transient network
// errors or 5xx/429 responses. Defaults to 2.
//
// Quirk: because Go's zero value for int is 0, and 0 is also a
// perfectly valid "use the default" sentinel here, pass -1 to
// explicitly disable retries.
Retries int
// UserAgent overrides the default "tripo3d-sdk-go/<version>" header.
UserAgent string
}
ClientOptions configures a Client. All fields are optional; APIKey falls back to the TRIPO_API_KEY environment variable when unset.
type CompleteMeshParams ¶
type CompleteMeshParams struct {
Input string `json:"input"`
Model *string `json:"model,omitempty"`
PartNames []string `json:"part_names,omitempty"`
Extra map[string]interface{} `json:"-"`
}
CompleteMeshParams are the parameters for POST /v3/mesh/complete.
type ConvertModelParams ¶
type ConvertModelParams struct {
Input string `json:"input"`
Format string `json:"format"`
Quad *bool `json:"quad,omitempty"`
FaceLimit *int64 `json:"face_limit,omitempty"`
TextureSize *int64 `json:"texture_size,omitempty"`
TextureFormat *string `json:"texture_format,omitempty"`
FlattenBottom *bool `json:"flatten_bottom,omitempty"`
FlattenBottomThreshold *float64 `json:"flatten_bottom_threshold,omitempty"`
PivotToCenterBottom *bool `json:"pivot_to_center_bottom,omitempty"`
WithAnimation *bool `json:"with_animation,omitempty"`
PackUV *bool `json:"pack_uv,omitempty"`
ForceSymmetry *bool `json:"force_symmetry,omitempty"`
Bake *bool `json:"bake,omitempty"`
PartNames []string `json:"part_names,omitempty"`
Extra map[string]interface{} `json:"-"`
}
ConvertModelParams are the parameters for POST /v3/models/convert.
type DecimateMeshParams ¶
type DecimateMeshParams struct {
Input string `json:"input"`
Model *string `json:"model,omitempty"`
FaceLimit *int64 `json:"face_limit,omitempty"`
Quad *bool `json:"quad,omitempty"`
Bake *bool `json:"bake,omitempty"`
PartNames []string `json:"part_names,omitempty"`
Extra map[string]interface{} `json:"-"`
}
DecimateMeshParams are the parameters for POST /v3/mesh/decimate.
type DownloadedModel ¶
DownloadedModel is the result of Client.DownloadModel.
type EditMultiviewParams ¶
type EditMultiviewParams struct {
OriginalTaskID *string `json:"original_task_id,omitempty"`
Extra map[string]interface{} `json:"-"`
}
EditMultiviewParams are the parameters for POST /v3/generation/edit-multiview.
type FileDescriptor ¶
type FileDescriptor struct {
FileToken string `json:"file_token,omitempty"`
URL string `json:"url,omitempty"`
Object *ObjectRef `json:"object,omitempty"`
Type string `json:"type,omitempty"`
}
FileDescriptor is the shape accepted by every endpoint that takes an image or model file as input. Exactly one of FileToken, URL, or Object should normally be set.
func File ¶
func File(input string) FileDescriptor
File builds a FileDescriptor from a bare string: an absolute URL (http:// or https://) is stored as URL, anything else is treated as an already-uploaded file_token.
func (FileDescriptor) IsEmpty ¶
func (f FileDescriptor) IsEmpty() bool
IsEmpty reports whether none of the descriptor's fields are populated.
type ImageToImageParams ¶
type ImageToImageParams struct {
File *FileDescriptor `json:"file,omitempty"`
Prompt *string `json:"prompt,omitempty"`
Extra map[string]interface{} `json:"-"`
}
ImageToImageParams are the parameters for POST /v3/generation/image-to-image.
type ImageToModelParams ¶
type ImageToModelParams struct {
File FileDescriptor `json:"file"`
Model *string `json:"model,omitempty"`
EnableImageAutofix *bool `json:"enable_image_autofix,omitempty"`
ModelSeed *int64 `json:"model_seed,omitempty"`
TextureSeed *int64 `json:"texture_seed,omitempty"`
Texture *bool `json:"texture,omitempty"`
PBR *bool `json:"pbr,omitempty"`
TextureQuality *string `json:"texture_quality,omitempty"`
TextureAlignment *string `json:"texture_alignment,omitempty"`
GeometryQuality *string `json:"geometry_quality,omitempty"`
FaceLimit *int64 `json:"face_limit,omitempty"`
AutoSize *bool `json:"auto_size,omitempty"`
Orientation *string `json:"orientation,omitempty"`
Quad *bool `json:"quad,omitempty"`
SmartLowPoly *bool `json:"smart_low_poly,omitempty"`
GenerateParts *bool `json:"generate_parts,omitempty"`
Compress *string `json:"compress,omitempty"`
ExportUV *bool `json:"export_uv,omitempty"`
Style *string `json:"style,omitempty"`
Extra map[string]interface{} `json:"-"`
}
ImageToModelParams are the parameters for POST /v3/generation/image-to-model.
type ImageToMultiviewParams ¶
type ImageToMultiviewParams struct {
File *FileDescriptor `json:"file,omitempty"`
Extra map[string]interface{} `json:"-"`
}
ImageToMultiviewParams are the parameters for POST /v3/generation/image-to-multiview.
type MultiviewToModelParams ¶
type MultiviewToModelParams struct {
Files *[4]FileDescriptor `json:"files,omitempty"`
OriginalTaskID *string `json:"original_task_id,omitempty"`
Model *string `json:"model,omitempty"`
ModelSeed *int64 `json:"model_seed,omitempty"`
TextureSeed *int64 `json:"texture_seed,omitempty"`
Texture *bool `json:"texture,omitempty"`
PBR *bool `json:"pbr,omitempty"`
TextureQuality *string `json:"texture_quality,omitempty"`
TextureAlignment *string `json:"texture_alignment,omitempty"`
FaceLimit *int64 `json:"face_limit,omitempty"`
AutoSize *bool `json:"auto_size,omitempty"`
Orientation *string `json:"orientation,omitempty"`
Quad *bool `json:"quad,omitempty"`
SmartLowPoly *bool `json:"smart_low_poly,omitempty"`
GenerateParts *bool `json:"generate_parts,omitempty"`
Compress *string `json:"compress,omitempty"`
Extra map[string]interface{} `json:"-"`
}
MultiviewToModelParams are the parameters for POST /v3/generation/multiview-to-model.
Files, when set, must contain exactly 4 items in [front, left, back, right] order. Individual items may be a zero-value FileDescriptor (empty) except the front view. Mutually exclusive with OriginalTaskID.
type OutputFormat ¶
type OutputFormat string
OutputFormat is a model conversion output format accepted by POST /v3/models/convert.
const ( OutputFormatGLTF OutputFormat = "GLTF" OutputFormatGLB OutputFormat = "GLB" OutputFormatUSDZ OutputFormat = "USDZ" OutputFormatFBX OutputFormat = "FBX" OutputFormatOBJ OutputFormat = "OBJ" OutputFormatSTL OutputFormat = "STL" OutputFormatThreeMF OutputFormat = "3MF" )
type RequestError ¶
RequestError is a transport-level failure: a network error, a non-2xx status without a parseable error envelope, or a malformed response body.
func (*RequestError) Error ¶
func (e *RequestError) Error() string
func (*RequestError) Unwrap ¶
func (e *RequestError) Unwrap() error
type RetargetAnimationParams ¶
type RetargetAnimationParams struct {
Input string `json:"input"`
Animation *string `json:"animation,omitempty"`
Animations []string `json:"animations,omitempty"`
OutFormat *string `json:"out_format,omitempty"`
BakeAnimation *bool `json:"bake_animation,omitempty"`
ExportWithGeometry *bool `json:"export_with_geometry,omitempty"`
AnimateInPlace *bool `json:"animate_in_place,omitempty"`
Extra map[string]interface{} `json:"-"`
}
RetargetAnimationParams are the parameters for POST /v3/animations/retarget. Provide either Animation (single preset) or Animations (up to 5).
type RigCheckParams ¶
RigCheckParams are the parameters for POST /v3/animations/rig-check.
type RigModelParams ¶
type RigModelParams struct {
Input string `json:"input"`
RigType *string `json:"rig_type,omitempty"`
Spec *string `json:"spec,omitempty"`
OutFormat *string `json:"out_format,omitempty"`
Extra map[string]interface{} `json:"-"`
}
RigModelParams are the parameters for POST /v3/animations/rig.
type SegmentMeshParams ¶
type SegmentMeshParams struct {
Input string `json:"input"`
Model *string `json:"model,omitempty"`
Extra map[string]interface{} `json:"-"`
}
SegmentMeshParams are the parameters for POST /v3/mesh/segment.
type Task ¶
type Task struct {
TaskID string `json:"task_id"`
Type string `json:"type"`
Status TaskStatus `json:"status"`
Progress int `json:"progress,omitempty"`
Input json.RawMessage `json:"input,omitempty"`
Output *TaskOutput `json:"output,omitempty"`
CreateTime int64 `json:"create_time,omitempty"`
RunningLeftTime int64 `json:"running_left_time,omitempty"`
QueuingNum int64 `json:"queuing_num,omitempty"`
ErrorCode int64 `json:"error_code,omitempty"`
ErrorMsg string `json:"error_msg,omitempty"`
// Raw holds the complete, unparsed JSON object for this task, so callers
// can reach fields this struct doesn't model yet.
Raw json.RawMessage `json:"-"`
}
Task is a task snapshot as returned by GET /v3/tasks/{task_id} and POST /v3/tasks/list.
func (*Task) PrimaryModelURL ¶
PrimaryModelURL returns the best-effort "main" model URL for this task, checking the common output fields in priority order. Returns "" if the task has no model output.
func (*Task) UnmarshalJSON ¶
UnmarshalJSON decodes the known fields while also retaining the full raw payload in Raw, so newly added API fields remain accessible.
type TaskError ¶
type TaskError struct {
Task *Task
}
TaskError indicates a task reached a non-successful terminal state (failed / cancelled / banned / expired).
type TaskOutput ¶
type TaskOutput struct {
Model string `json:"model,omitempty"`
ModelURL string `json:"model_url,omitempty"`
ModelURLs []string `json:"model_urls,omitempty"`
BaseModel string `json:"base_model,omitempty"`
PBRModel string `json:"pbr_model,omitempty"`
RenderedImage string `json:"rendered_image,omitempty"`
RenderedImageURL string `json:"rendered_image_url,omitempty"`
Riggable *bool `json:"riggable,omitempty"`
RigType string `json:"rig_type,omitempty"`
// Raw holds the complete, unparsed JSON object for this output.
Raw json.RawMessage `json:"-"`
}
TaskOutput is the `output` object of a completed task. Fields vary by task type, so everything is optional.
func (*TaskOutput) IsRiggable ¶
func (o *TaskOutput) IsRiggable() bool
IsRiggable reports the rig-check verdict, defaulting to false when unset.
func (*TaskOutput) PrimaryModelURL ¶
func (o *TaskOutput) PrimaryModelURL() string
PrimaryModelURL returns the best-effort "main" model URL, checking the common output fields in priority order. Safe to call on a nil receiver.
func (*TaskOutput) UnmarshalJSON ¶
func (o *TaskOutput) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes the known fields while also retaining the full raw payload in Raw.
type TaskStatus ¶
type TaskStatus string
TaskStatus is the lifecycle status of a task, as returned by GET /v3/tasks/{task_id}.
const ( TaskStatusQueued TaskStatus = "queued" TaskStatusRunning TaskStatus = "running" TaskStatusSuccess TaskStatus = "success" TaskStatusFailed TaskStatus = "failed" TaskStatusCancelled TaskStatus = "cancelled" TaskStatusUnknown TaskStatus = "unknown" TaskStatusBanned TaskStatus = "banned" TaskStatusExpired TaskStatus = "expired" )
func (TaskStatus) IsSuccess ¶
func (s TaskStatus) IsSuccess() bool
IsSuccess reports whether this status represents a successful completion.
func (TaskStatus) IsTerminal ¶
func (s TaskStatus) IsTerminal() bool
IsTerminal reports whether a task in this status will not change further.
type TextToImageParams ¶
type TextToImageParams struct {
Prompt string `json:"prompt"`
Model *string `json:"model,omitempty"`
Extra map[string]interface{} `json:"-"`
}
TextToImageParams are the parameters for POST /v3/generation/text-to-image.
type TextToModelParams ¶
type TextToModelParams struct {
Prompt string `json:"prompt"`
Model *string `json:"model,omitempty"`
NegativePrompt *string `json:"negative_prompt,omitempty"`
ImageSeed *int64 `json:"image_seed,omitempty"`
ModelSeed *int64 `json:"model_seed,omitempty"`
TextureSeed *int64 `json:"texture_seed,omitempty"`
Texture *bool `json:"texture,omitempty"`
PBR *bool `json:"pbr,omitempty"`
TextureQuality *string `json:"texture_quality,omitempty"`
GeometryQuality *string `json:"geometry_quality,omitempty"`
FaceLimit *int64 `json:"face_limit,omitempty"`
AutoSize *bool `json:"auto_size,omitempty"`
Quad *bool `json:"quad,omitempty"`
SmartLowPoly *bool `json:"smart_low_poly,omitempty"`
GenerateParts *bool `json:"generate_parts,omitempty"`
Compress *string `json:"compress,omitempty"`
ExportUV *bool `json:"export_uv,omitempty"`
Style *string `json:"style,omitempty"`
// Extra carries forward-compatible fields not yet modeled above; they
// are merged into the JSON payload alongside the typed fields.
Extra map[string]interface{} `json:"-"`
}
TextToModelParams are the parameters for POST /v3/generation/text-to-model.
type TextureFormat ¶
type TextureFormat string
TextureFormat is a texture image format supported by the conversion API.
const ( TextureFormatBMP TextureFormat = "BMP" TextureFormatDPX TextureFormat = "DPX" TextureFormatHDR TextureFormat = "HDR" TextureFormatJPEG TextureFormat = "JPEG" TextureFormatOpenEXR TextureFormat = "OPEN_EXR" TextureFormatPNG TextureFormat = "PNG" TextureFormatTarga TextureFormat = "TARGA" TextureFormatTIFF TextureFormat = "TIFF" TextureFormatWebP TextureFormat = "WEBP" )
type TextureModelParams ¶
type TextureModelParams struct {
Input string `json:"input"`
Texture *bool `json:"texture,omitempty"`
PBR *bool `json:"pbr,omitempty"`
ModelSeed *int64 `json:"model_seed,omitempty"`
TextureSeed *int64 `json:"texture_seed,omitempty"`
TextureQuality *string `json:"texture_quality,omitempty"`
TextureAlignment *string `json:"texture_alignment,omitempty"`
TextPrompt *string `json:"text_prompt,omitempty"`
ImagePrompt *FileDescriptor `json:"image_prompt,omitempty"`
StyleImage *FileDescriptor `json:"style_image,omitempty"`
Compress *string `json:"compress,omitempty"`
Bake *bool `json:"bake,omitempty"`
PartNames []string `json:"part_names,omitempty"`
Extra map[string]interface{} `json:"-"`
}
TextureModelParams are the parameters for POST /v3/models/texture.
type TimeoutError ¶
TimeoutError indicates WaitForTask exceeded the caller-supplied timeout.
func (*TimeoutError) Error ¶
func (e *TimeoutError) Error() string
type UploadedFile ¶
type UploadedFile struct {
FileToken string `json:"file_token"`
}
UploadedFile is the POST /v3/files response payload.
type WaitOptions ¶
type WaitOptions struct {
// PollInterval is the delay between polling attempts. Defaults to 2s.
PollInterval time.Duration
// Timeout bounds the overall polling loop. Zero means wait
// indefinitely (until ctx is cancelled).
Timeout time.Duration
// IgnoreFailure, when true, returns the task even if its terminal
// status isn't "success", instead of returning a *TaskError.
IgnoreFailure bool
// OnProgress, if set, is invoked after every poll (including the
// final one) with the latest task snapshot.
OnProgress func(*Task)
}
WaitOptions configures Client.WaitForTask.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
image-to-image
command
Command image-to-image applies a style/edit transformation to an existing image and saves the result to disk.
|
Command image-to-image applies a style/edit transformation to an existing image and saves the result to disk. |
|
image-to-model
command
Command image-to-model converts a local or remote image into a 3D model.
|
Command image-to-model converts a local or remote image into a 3D model. |
|
rig-and-animate
command
Command rig-and-animate runs an end-to-end "game-ready character" pipeline:
|
Command rig-and-animate runs an end-to-end "game-ready character" pipeline: |
|
text-to-image
command
Command text-to-image generates a concept image from a text prompt, waits for completion, then saves every URL found in the task output to disk.
|
Command text-to-image generates a concept image from a text prompt, waits for completion, then saves every URL found in the task output to disk. |
|
text-to-model
command
Command text-to-model generates a 3D model from a text prompt, waits for completion, then saves the resulting GLB to disk.
|
Command text-to-model generates a 3D model from a text prompt, waits for completion, then saves the resulting GLB to disk. |