mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-11-29 03:26:12 +00:00
215 lines
27 KiB
Markdown
215 lines
27 KiB
Markdown
<!-- Generated by sd-cli -M dgl. Update with the dgl-update-builtins CMake target. -->
|
|
# Built-in DGL functions
|
|
|
|
Optional parameters are marked with `?`. Default values follow `=`. See [DGL syntax](dgl.md#dgl-syntax) for `fn`, `map` and `fold`.
|
|
|
|
| Function | Parameters | Returns |
|
|
|---|---|---|
|
|
| `add_noise` | `predict: predictor`, `base: tensor`, `noise: tensor`, `sigma: number` | `tensor` |
|
|
| `animatediff::apply` | `model: denoiser`, `motion: animatediff` | `denoiser` |
|
|
| `animatediff::load` (resource) | `path: string`, `family?: string = "auto"`, `wtype?: string = "auto"`, `conv_scale?: number = 0`, `linear_scale?: number = 0`, `attn_scale?: number = 0`, `backend?: string = ""`, `params_backend?: string = ""`, `split_mode?: string = ""`, `model_args?: string = ""`, `tensor_type_rules?: string = ""`, `flash_attn_mode?: string = "auto"`, `conv_direct_mode?: string = "auto"`, `sage_attn?: bool = false`, `linear_type?: string = "auto"` | `animatediff` |
|
|
| `apg` | `positive: predictor`, `negative: predictor`, `scale: number`, `image_only?: predictor`, `image_scale?: number = 1`, `schedule?: list<number>`, `eta?: number = 1`, `momentum?: number = 0`, `norm_threshold?: number = 0`, `norm_threshold_smoothing?: number = 0` | `predictor` |
|
|
| `apply_lora` | `model: model`, `lora: lora`, `weight?: number = 1.0`, `mode?: string` | same type as `model` |
|
|
| `audio::load` | `path: string` | `dict`<br>`sample_rate: int`<br>`samples: tensor` |
|
|
| `audio::save` | `path: string`, `audio: dict`, `format?: string = "f32"` | `void` |
|
|
| `audio_latent_shape` | `vae: audio_vae`, `frames: int`, `fps: int` | `tensor` |
|
|
| `audio_vae_decode` | `vae: audio_vae`, `latent: tensor` | `dict`<br>`sample_rate: int`<br>`samples: tensor` |
|
|
| `audio_vae_encode` | `vae: audio_vae`, `samples: tensor`, `sample_rate: int` | `tensor` |
|
|
| `cache` | `mode?: string = "disabled"`, `reuse_threshold?: number`, `start_percent?: number`, `end_percent?: number`, `error_decay_rate?: number`, `use_relative_threshold?: bool`, `reset_error_on_compute?: bool`, `residual_diff_threshold?: number`, `max_warmup_steps?: int`, `max_cached_steps?: int`, `max_continuous_cached_steps?: int`, `taylorseer_n_derivatives?: int`, `taylorseer_skip_interval?: int`, `scm_mask?: string`, `spectrum_w?: number`, `spectrum_m?: int`, `spectrum_lam?: number`, `spectrum_window_size?: int`, `spectrum_flex_window?: number`, `spectrum_warmup_steps?: int`, `spectrum_stop_percent?: number` | `dict`<br>`end_percent: number`<br>`error_decay_rate: number`<br>`max_cached_steps: int`<br>`max_continuous_cached_steps: int`<br>`max_warmup_steps: int`<br>`mode: string`<br>`reset_error_on_compute: bool`<br>`residual_diff_threshold: number`<br>`reuse_threshold: number`<br>`scm_mask: string`<br>`spectrum_flex_window: number`<br>`spectrum_lam: number`<br>`spectrum_m: int`<br>`spectrum_stop_percent: number`<br>`spectrum_w: number`<br>`spectrum_warmup_steps: int`<br>`spectrum_window_size: int`<br>`start_percent: number`<br>`taylorseer_n_derivatives: int`<br>`taylorseer_skip_interval: int`<br>`use_relative_threshold: bool` |
|
|
| `cfg` | `positive: predictor`, `negative: predictor`, `scale: number`, `image_only?: predictor`, `image_scale?: number = 1`, `schedule?: list<number>` | `predictor` |
|
|
| `controlnet::apply` | `condition: dict`, `model: control_net`, `hint: tensor`, `strength?: number = 1`, `start_sigma?: number`, `end_sigma?: number`, `type?: string = "none"` | same type as `condition`<br>`controls: control_bindings` |
|
|
| `controlnet::load` (resource) | `path: string`, `family?: string = "auto"`, `wtype?: string = "auto"`, `conv_scale?: number = 0`, `linear_scale?: number = 0`, `attn_scale?: number = 0`, `backend?: string = ""`, `params_backend?: string = ""`, `split_mode?: string = ""`, `model_args?: string = ""`, `tensor_type_rules?: string = ""`, `flash_attn_mode?: string = "auto"`, `conv_direct_mode?: string = "auto"`, `sage_attn?: bool = false`, `linear_type?: string = "auto"` | `control_net` |
|
|
| `denoiser_scalings` | `predict: predictor`, `sigma: number` | `dict`<br>`input_scale: number`<br>`output_scale: number`<br>`skip_scale: number` |
|
|
| `detections::box_masks` | `image: tensor`, `detections: dict` | `list<tensor>` |
|
|
| `detections::detect` | `detector: detector`, `image: tensor`, `input_size?: int = 640`, `confidence?: number = 0.3`, `nms?: number = 0.45`, `max_detections?: int = 100` | `dict`<br>`class_ids: tensor`<br>`scores: tensor`<br>`xyxy: tensor` |
|
|
| `detections::filter` | `image: tensor`, `detections: dict`, `top_k?: int = 0`, `top_k_by?: string = "area"`, `min_area_ratio?: number = 0`, `max_area_ratio?: number = 1`, `sort_by?: string = "none"` | `dict`<br>`class_ids: tensor`<br>`scores: tensor`<br>`xyxy: tensor` |
|
|
| `detections::to_regions` | `image: tensor`, `detections: dict` | `dict`<br>`boxes: tensor`<br>`height: int`<br>`width: int` |
|
|
| `dit_to_vae_latents` | `vae: vae`, `latent: tensor` | `tensor` |
|
|
| `encode_audio` | `encoder: audio_encoder`, `samples: tensor`, `sample_rate: int` | `tensor` |
|
|
| `encode_prompt` | `encoder: text_encoder`, `text: string`, `width?: int = 512`, `height?: int = 512`, `clip_skip?: int = -1`, `system?: string`, `media?: list<any>`, `image_bindings?: dict`, `raw?: bool = false` | `dict`<br>`concat: tensor`<br>`crossattn: tensor`<br>`extra_crossattn: list<tensor>`<br>`image_embed_indices: list<tensor>`<br>`image_embeds: list<tensor>`<br>`input_ids: tensor`<br>`position_ids: tensor`<br>`ref_audios: list<tensor>`<br>`ref_images: list<tensor>`<br>`reference_blocks: list<dict>`<br>`reference_blocks.audio: int`<br>`reference_blocks.kind: string`<br>`reference_blocks.video: int`<br>`t5_ids: tensor`<br>`t5_weights: tensor`<br>`token_types: tensor`<br>`vector: tensor`<br>`vinput_mask: tensor` |
|
|
| `encode_vision` | `encoder: vision_encoder`, `image: tensor`, `pooled?: bool = false`, `clip_skip?: int = -2`, `zero?: bool = false`, `zero_input?: bool = false` | `tensor` |
|
|
| `image::canny` | `image: tensor`, `high_threshold?: number = 0.08`, `low_threshold?: number = 0.04`, `weak?: number = 0.5`, `strong?: number = 1`, `invert?: bool = false` | `tensor` |
|
|
| `image::encode` | `image: tensor`, `format?: string = "png"` | `dict`<br>`data: bytes`<br>`mime_type: string` |
|
|
| `image::load` | `path: string` | `tensor` |
|
|
| `image::load_dir` | `path: string`, `max_images?: int = 0` | `list<tensor>` |
|
|
| `image::save` | `path: string`, `image: tensor` | `void` |
|
|
| `image::to_f32` | `image: tensor`, `channels?: int = 0` | `tensor` |
|
|
| `image::to_u8` | `pixels: tensor` | `tensor` |
|
|
| `ip_adapter::apply` | `condition: dict`, `adapter: ip_adapter`, `tokens: tensor`, `strength?: number = 1`, `start_sigma?: number`, `end_sigma?: number` | same type as `condition`<br>`ip_adapters: ip_adapter_bindings` |
|
|
| `ip_adapter::load` (resource) | `path: string`, `family?: string = "auto"`, `wtype?: string = "auto"`, `conv_scale?: number = 0`, `linear_scale?: number = 0`, `attn_scale?: number = 0`, `backend?: string = ""`, `params_backend?: string = ""`, `split_mode?: string = ""`, `model_args?: string = ""`, `tensor_type_rules?: string = ""`, `flash_attn_mode?: string = "auto"`, `conv_direct_mode?: string = "auto"`, `sage_attn?: bool = false`, `linear_type?: string = "auto"` | `ip_adapter` |
|
|
| `ip_adapter::project` | `adapter: ip_adapter`, `embedding: tensor` | `tensor` |
|
|
| `latent_shape` | `vae: vae`, `width: int`, `height: int`, `batch?: int = 1`, `frames?: int` | `tensor` |
|
|
| `list::replace` | `items: list<any>`, `index: int`, `value: any` | `list<any>` |
|
|
| `load_audio_encoder` (resource) | `path: string`, `family?: string = "auto"`, `wtype?: string = "auto"`, `conv_scale?: number = 0`, `linear_scale?: number = 0`, `attn_scale?: number = 0`, `backend?: string = ""`, `params_backend?: string = ""`, `split_mode?: string = ""`, `model_args?: string = ""`, `tensor_type_rules?: string = ""`, `flash_attn_mode?: string = "auto"`, `conv_direct_mode?: string = "auto"`, `sage_attn?: bool = false`, `linear_type?: string = "auto"` | `audio_encoder` |
|
|
| `load_audio_vae` (resource) | `path: string`, `family?: string = "auto"`, `wtype?: string = "auto"`, `conv_scale?: number = 0`, `linear_scale?: number = 0`, `attn_scale?: number = 0`, `backend?: string = ""`, `params_backend?: string = ""`, `split_mode?: string = ""`, `model_args?: string = ""`, `tensor_type_rules?: string = ""`, `flash_attn_mode?: string = "auto"`, `conv_direct_mode?: string = "auto"`, `sage_attn?: bool = false`, `family_from?: string = ""`, `linear_type?: string = "auto"` | `audio_vae` |
|
|
| `load_detector` (resource) | `path: string`, `backend?: string = ""`, `params_backend?: string = ""`, `linear_type?: string = "auto"` | `detector` |
|
|
| `load_dit` (resource) | `path: string`, `family?: string = "auto"`, `wtype?: string = "auto"`, `conv_scale?: number = 0`, `linear_scale?: number = 0`, `attn_scale?: number = 0`, `backend?: string = ""`, `params_backend?: string = ""`, `split_mode?: string = ""`, `model_args?: string = ""`, `tensor_type_rules?: string = ""`, `flash_attn_mode?: string = "auto"`, `conv_direct_mode?: string = "auto"`, `sage_attn?: bool = false`, `linear_type?: string = "auto"` | `denoiser` |
|
|
| `load_latent_upscaler` (resource) | `path: string`, `family?: string = "auto"`, `wtype?: string = "auto"`, `conv_scale?: number = 0`, `linear_scale?: number = 0`, `attn_scale?: number = 0`, `backend?: string = ""`, `params_backend?: string = ""`, `split_mode?: string = ""`, `model_args?: string = ""`, `tensor_type_rules?: string = ""`, `flash_attn_mode?: string = "auto"`, `conv_direct_mode?: string = "auto"`, `sage_attn?: bool = false`, `linear_type?: string = "auto"` | `latent_upscaler` |
|
|
| `load_lora` (resource) | `path: string` | `lora` |
|
|
| `load_tae` (resource) | `path: string`, `family?: string = "auto"`, `wtype?: string = "auto"`, `conv_scale?: number = 0`, `linear_scale?: number = 0`, `attn_scale?: number = 0`, `backend?: string = ""`, `params_backend?: string = ""`, `split_mode?: string = ""`, `model_args?: string = ""`, `tensor_type_rules?: string = ""`, `flash_attn_mode?: string = "auto"`, `conv_direct_mode?: string = "auto"`, `sage_attn?: bool = false`, `family_from?: string = ""`, `decode_only?: bool = false`, `linear_type?: string = "auto"` | `vae` |
|
|
| `load_text_encoder` (resource) | `path: string`, `family?: string = "auto"`, `wtype?: string = "auto"`, `conv_scale?: number = 0`, `linear_scale?: number = 0`, `attn_scale?: number = 0`, `backend?: string = ""`, `params_backend?: string = ""`, `split_mode?: string = ""`, `model_args?: string = ""`, `tensor_type_rules?: string = ""`, `flash_attn_mode?: string = "auto"`, `conv_direct_mode?: string = "auto"`, `sage_attn?: bool = false`, `family_from?: string = ""`, `tokenizer?: string = ""`, `vision_path?: string = ""`, `projection_path?: string = ""`, `connectors_path?: string = ""`, `t5_path?: string = ""`, `clip_l_path?: string = ""`, `clip_g_path?: string = ""`, `linear_type?: string = "auto"` | `text_encoder` |
|
|
| `load_unet` (resource) (alias of `load_dit`) | `path: string`, `family?: string = "auto"`, `wtype?: string = "auto"`, `conv_scale?: number = 0`, `linear_scale?: number = 0`, `attn_scale?: number = 0`, `backend?: string = ""`, `params_backend?: string = ""`, `split_mode?: string = ""`, `model_args?: string = ""`, `tensor_type_rules?: string = ""`, `flash_attn_mode?: string = "auto"`, `conv_direct_mode?: string = "auto"`, `sage_attn?: bool = false`, `linear_type?: string = "auto"` | `denoiser` |
|
|
| `load_upscaler` (resource) | `path: string`, `tile_size?: int = 128`, `backend?: string = ""`, `params_backend?: string = ""`, `direct?: bool = false`, `linear_type?: string = "auto"` | `upscaler` |
|
|
| `load_vae` (resource) | `path: string`, `family?: string = "auto"`, `wtype?: string = "auto"`, `conv_scale?: number = 0`, `linear_scale?: number = 0`, `attn_scale?: number = 0`, `backend?: string = ""`, `params_backend?: string = ""`, `split_mode?: string = ""`, `model_args?: string = ""`, `tensor_type_rules?: string = ""`, `flash_attn_mode?: string = "auto"`, `conv_direct_mode?: string = "auto"`, `sage_attn?: bool = false`, `family_from?: string = ""`, `vae_format?: string = "auto"`, `linear_type?: string = "auto"` | `vae` |
|
|
| `load_vision_encoder` (resource) | `path: string`, `family?: string = "auto"`, `wtype?: string = "auto"`, `conv_scale?: number = 0`, `linear_scale?: number = 0`, `attn_scale?: number = 0`, `backend?: string = ""`, `params_backend?: string = ""`, `split_mode?: string = ""`, `model_args?: string = ""`, `tensor_type_rules?: string = ""`, `flash_attn_mode?: string = "auto"`, `conv_direct_mode?: string = "auto"`, `sage_attn?: bool = false`, `linear_type?: string = "auto"` | `vision_encoder` |
|
|
| `ltx::video_positions` | `like: tensor`, `keyframe_latent_frames: int`, `keyframe_frame_index: int`, `keyframe_pixel_frames: int`, `fps?: int = 24`, `spatial_scale?: int = 32`, `temporal_scale?: int = 8`, `causal?: bool = true` | `tensor` |
|
|
| `make_rng` | `algorithm?: string = "cuda"`, `seed?: int = 0` | `rng` |
|
|
| `make_sigmas` | `predict: predictor`, `latent: tensor`, `scheduler?: string = "discrete"`, `steps: int`, `flow_shift?: number = 0`, `sequence_length?: int`, `extra_args?: string = ""` | `tensor` |
|
|
| `math::add` | `a: number`, `b: number` | `number` |
|
|
| `math::ceil` | `value: number` | `int` |
|
|
| `math::ceil_div` | `numerator: int`, `denominator: int` | `int` |
|
|
| `math::div` | `a: number`, `b: number` | `number` |
|
|
| `math::floor` | `value: number` | `int` |
|
|
| `math::min` | `a: int`, `b: int` | `int` |
|
|
| `math::mul` | `a: number`, `b: number` | `number` |
|
|
| `math::product` | `items: i64 tensor or list<int>` | `int` |
|
|
| `math::round` | `value: number` | `int` |
|
|
| `math::sub` | `a: number`, `b: number` | `number` |
|
|
| `media::save` | `path: string`, `media: dict` | `void` |
|
|
| `photomaker::apply` | `condition: dict`, `photomaker: photomaker`, `tokens: tensor`, `mask: tensor` | same type as `condition`<br>`crossattn: tensor` |
|
|
| `photomaker::encode_images` | `photomaker: photomaker`, `images: list<tensor>`, `id_embedding?: tensor` | `tensor` |
|
|
| `photomaker::encode_prompt` | `encoder: text_encoder`, `text: string`, `tokens: tensor`, `width?: int = 1024`, `height?: int = 1024`, `clip_skip?: int = -1` | `dict`<br>`condition: dict`<br>`condition.concat: tensor`<br>`condition.crossattn: tensor`<br>`condition.extra_crossattn: list<tensor>`<br>`condition.image_embed_indices: list<tensor>`<br>`condition.image_embeds: list<tensor>`<br>`condition.input_ids: tensor`<br>`condition.position_ids: tensor`<br>`condition.ref_audios: list<tensor>`<br>`condition.ref_images: list<tensor>`<br>`condition.reference_blocks: list<dict>`<br>`condition.reference_blocks.audio: int`<br>`condition.reference_blocks.kind: string`<br>`condition.reference_blocks.video: int`<br>`condition.t5_ids: tensor`<br>`condition.t5_weights: tensor`<br>`condition.token_types: tensor`<br>`condition.vector: tensor`<br>`condition.vinput_mask: tensor`<br>`mask: tensor`<br>`plain: dict`<br>`plain.concat: tensor`<br>`plain.crossattn: tensor`<br>`plain.extra_crossattn: list<tensor>`<br>`plain.image_embed_indices: list<tensor>`<br>`plain.image_embeds: list<tensor>`<br>`plain.input_ids: tensor`<br>`plain.position_ids: tensor`<br>`plain.ref_audios: list<tensor>`<br>`plain.ref_images: list<tensor>`<br>`plain.reference_blocks: list<dict>`<br>`plain.reference_blocks.audio: int`<br>`plain.reference_blocks.kind: string`<br>`plain.reference_blocks.video: int`<br>`plain.t5_ids: tensor`<br>`plain.t5_weights: tensor`<br>`plain.token_types: tensor`<br>`plain.vector: tensor`<br>`plain.vinput_mask: tensor` |
|
|
| `photomaker::load` (resource) | `path: string`, `family?: string = "auto"`, `wtype?: string = "auto"`, `conv_scale?: number = 0`, `linear_scale?: number = 0`, `attn_scale?: number = 0`, `backend?: string = ""`, `params_backend?: string = ""`, `split_mode?: string = ""`, `model_args?: string = ""`, `tensor_type_rules?: string = ""`, `flash_attn_mode?: string = "auto"`, `conv_direct_mode?: string = "auto"`, `sage_attn?: bool = false`, `linear_type?: string = "auto"` | `photomaker` |
|
|
| `predictor` | `model: denoiser`, `condition: dict`, `prediction?: string = "auto"`, `concat?: tensor`, `ref_latents?: list<tensor>`, `ref_audios?: list<tensor>`, `reference_blocks?: list<dict>`, `keyframe_indices?: list<int>`, `ref_index_mode?: string = "fixed"`, `force_ref_timestep_zero?: bool = false`, `ref_rope_anchor?: string = "default"`, `guidance?: number = 3.5`, `skip_layers?: list<int>`, `vace_context?: tensor`, `vace_strength?: number = 1`, `audio_embedding?: tensor`, `video_positions?: tensor`, `audio_length?: int = 0`, `fps?: number = 24`, `video_sigma_shift?: number = 12`, `audio_sigma_shift?: number = 3`, `circular_x?: bool = false`, `circular_y?: bool = false`, `transform?: fn`, `transform_args?: dict` | `predictor` |
|
|
| `preview` | `decoder?: vae`, `circular_x?: bool = false`, `circular_y?: bool = false` | `sampling_observer` |
|
|
| `pulid::apply` | `condition: dict`, `pulid: pulid`, `embedding: tensor`, `strength?: number = 1`, `start_sigma?: number`, `end_sigma?: number` | same type as `condition`<br>`pulid: pulid_bindings` |
|
|
| `pulid::load` (resource) | `path: string`, `family?: string = "auto"`, `wtype?: string = "auto"`, `conv_scale?: number = 0`, `linear_scale?: number = 0`, `attn_scale?: number = 0`, `backend?: string = ""`, `params_backend?: string = ""`, `split_mode?: string = ""`, `model_args?: string = ""`, `tensor_type_rules?: string = ""`, `flash_attn_mode?: string = "auto"`, `conv_direct_mode?: string = "auto"`, `sage_attn?: bool = false`, `linear_type?: string = "auto"` | `pulid` |
|
|
| `pulid::load_embedding` | `path: string` | `tensor` |
|
|
| `regions::crop` | `image: tensor`, `regions: dict` | `list<tensor>` |
|
|
| `regions::from_boxes` | `width: int`, `height: int`, `boxes: any` | `dict`<br>`boxes: tensor`<br>`height: int`<br>`width: int` |
|
|
| `regions::paste` | `background: tensor`, `foregrounds: list<tensor>`, `regions: dict` | `tensor` |
|
|
| `regions::plan_mask_crops` | `masks: list<tensor>`, `aspect?: i64 tensor or list<int> = [1, 1]`, `padding?: int = 32`, `only_masked?: bool = true` | `list<dict>`<br>`box: tensor`<br>`index: int`<br>`mask: tensor` |
|
|
| `relayvsr::decode` | `flash: vae`, `latent: tensor`, `frames: tensor`, `keyframe_indices: tensor`, `detail?: number = 1` | `tensor` |
|
|
| `relayvsr::latent_shape` | `dit: denoiser`, `keyframes: tensor` | `tensor` |
|
|
| `relayvsr::positive_embedding` | `dit: denoiser` | `tensor` |
|
|
| `sample` | `start: tensor`, `sigmas: tensor`, `predict: predictor`, `rng: rng`, `method?: string = "euler"`, `eta?: number = 1`, `base?: tensor`, `denoise_mask?: tensor`, `mask_input?: bool = false`, `extra_args?: string = ""`, `finish?: bool`, `cache?: dict`, `observer?: sampling_observer` | `tensor` |
|
|
| `seedvr2::positive_embedding` | `dit: denoiser` | `tensor` |
|
|
| `sefi::make_sigmas` | `steps: int`, `alpha?: number = 1`, `delta?: number = 0.1` | `dict`<br>`semantic_sigmas: tensor`<br>`sigmas: tensor` |
|
|
| `sefi::sample` | `start: tensor`, `sigmas: tensor`, `semantic_sigmas: tensor`, `predict: predictor`, `rng: rng`, `method?: string = "euler"`, `eta?: number = 1`, `base?: tensor`, `denoise_mask?: tensor`, `mask_input?: bool = false`, `extra_args?: string = ""`, `finish?: bool`, `cache?: dict`, `observer?: sampling_observer` | `tensor` |
|
|
| `slg` | `base: predictor`, `positive: predictor`, `skipped: predictor`, `scale: number`, `start_sigma?: number`, `end_sigma?: number`, `start_step_fraction?: number`, `stop_step_fraction?: number` | `predictor` |
|
|
| `switch_predictor` | `before: predictor`, `after: predictor`, `after_steps: int` | `predictor` |
|
|
| `t_to_sigma` | `predict: predictor`, `t: number`, `flow_shift?: number = 0`, `latent?: tensor`, `sequence_length?: int` | `number` |
|
|
| `tensor::add` | `a: any`, `b: any` | `tensor` |
|
|
| `tensor::affine` | `input: tensor`, `scale?: number = 1`, `offset?: number = 0` | `tensor` |
|
|
| `tensor::arange` | `start: int`, `end: int`, `step?: int = 1` | `tensor` |
|
|
| `tensor::broadcast_to` | `input: tensor`, `shape: i64 tensor or list<int>` | `tensor` |
|
|
| `tensor::cast` | `input: tensor`, `dtype: string` | `tensor` |
|
|
| `tensor::clamp` | `input: tensor`, `min: number`, `max: number` | `tensor` |
|
|
| `tensor::concat` | `items: list<tensor>`, `axis: int` | `tensor` |
|
|
| `tensor::count_nonzero` | `input: tensor` | `int` |
|
|
| `tensor::crop` | `input: tensor`, `axes: i64 tensor or list<int>`, `start: i64 tensor or list<int>`, `size: i64 tensor or list<int>` | `tensor` |
|
|
| `tensor::div` | `a: any`, `b: any` | `tensor` |
|
|
| `tensor::full` | `shape: i64 tensor or list<int>`, `value: number`, `dtype?: string = "f32"` | `tensor` |
|
|
| `tensor::gaussian_blur` | `input: tensor`, `sigma: number`, `radius: int`, `axes?: i64 tensor or list<int>`, `precision?: string = "auto"` | `tensor` |
|
|
| `tensor::grayscale` | `input: tensor`, `axis?: int = 0` | `tensor` |
|
|
| `tensor::index` | `input: tensor`, `indices: list<dict>` | `any` |
|
|
| `tensor::index_fill` | `input: tensor`, `axis: int`, `indices: i64 tensor or list<int>`, `value: number` | `tensor` |
|
|
| `tensor::index_select` | `input: tensor`, `axis: int`, `indices: i64 tensor or list<int>` | `tensor` |
|
|
| `tensor::interpolate` | `input: tensor`, `size: i64 tensor or list<int>`, `axes?: i64 tensor or list<int>`, `mode?: string = "bilinear"`, `antialias?: bool = false` | `tensor` |
|
|
| `tensor::lerp` | `a: any`, `b: any`, `weight: any` | `tensor` |
|
|
| `tensor::literal` | `dtype: string`, `shape: i64 tensor or list<int>`, `data: string` | `tensor` |
|
|
| `tensor::load` | `path: string` | `tensor` |
|
|
| `tensor::max_pool2d` | `input: tensor`, `kernel: i64 tensor or list<int>`, `axes?: i64 tensor or list<int>`, `stride?: i64 tensor or list<int>`, `padding_before?: i64 tensor or list<int>`, `padding_after?: i64 tensor or list<int>`, `pad_value?: number` | `tensor` |
|
|
| `tensor::maximum` | `a: tensor`, `b: tensor` | `tensor` |
|
|
| `tensor::min_pool2d` | `input: tensor`, `kernel: i64 tensor or list<int>`, `axes?: i64 tensor or list<int>`, `stride?: i64 tensor or list<int>`, `padding_before?: i64 tensor or list<int>`, `padding_after?: i64 tensor or list<int>`, `pad_value?: number` | `tensor` |
|
|
| `tensor::mul` | `a: any`, `b: any` | `tensor` |
|
|
| `tensor::numel` | `input: tensor` | `int` |
|
|
| `tensor::pad` | `input: tensor`, `pad: i64 tensor or list<int>`, `mode?: string = "constant"`, `value?: number = 0` | `tensor` |
|
|
| `tensor::permute` | `input: tensor`, `axes: i64 tensor or list<int>` | `tensor` |
|
|
| `tensor::randn_like` | `like: tensor`, `rng: rng` | `tensor` |
|
|
| `tensor::replace_slice` | `input: tensor`, `value: tensor`, `axis: int`, `start: int` | `tensor` |
|
|
| `tensor::reshape` | `input: tensor`, `shape: i64 tensor or list<int>` | `tensor` |
|
|
| `tensor::save` | `path: string`, `tensor: tensor` | `void` |
|
|
| `tensor::shape` | `input: tensor` | `tensor` |
|
|
| `tensor::threshold` | `input: tensor`, `threshold: number`, `low?: number = 0`, `high?: number = 1` | `tensor` |
|
|
| `tensor::to_list` | `input: tensor`, `element?: string = "auto"` | `list<any>` |
|
|
| `tensor::translate` | `input: tensor`, `axes: i64 tensor or list<int>`, `offset: i64 tensor or list<int>`, `value?: number = 0` | `tensor` |
|
|
| `tensor::unsqueeze` | `input: tensor`, `axis: int` | `tensor` |
|
|
| `tensor::vector` | `values: list<number>`, `dtype?: string = "f32"` | `tensor` |
|
|
| `tensor::zeros` | `shape: i64 tensor or list<int>`, `dtype?: string = "f32"` | `tensor` |
|
|
| `tensor::zeros_like` | `like: tensor` | `tensor` |
|
|
| `tiling` | `enabled?: bool = true`, `temporal_tiling?: bool = false`, `tile_size_w?: int = 0`, `tile_size_h?: int = 0`, `target_overlap?: number = 0.5`, `rel_size_w?: number = 0`, `rel_size_h?: number = 0`, `extra_args?: string = ""` | `dict`<br>`enabled: bool`<br>`extra_args: string`<br>`rel_size_h: number`<br>`rel_size_w: number`<br>`target_overlap: number`<br>`temporal_tiling: bool`<br>`tile_size_h: int`<br>`tile_size_w: int` |
|
|
| `unet_to_vae_latents` (alias of `dit_to_vae_latents`) | `vae: vae`, `latent: tensor` | `tensor` |
|
|
| `upscale` | `upscaler: upscaler`, `image: tensor`, `factor?: int` | `tensor` |
|
|
| `upscale_latent` | `upscaler: latent_upscaler`, `latent: tensor`, `width?: int`, `height?: int` | `tensor` |
|
|
| `vae_decode` | `vae: vae`, `latent: tensor`, `tiling?: dict`, `circular_x?: bool = false`, `circular_y?: bool = false`, `dtype?: string = "u8"` | `tensor` |
|
|
| `vae_encode` | `vae: vae`, `pixels: tensor`, `rng: rng`, `tiling?: dict`, `circular_x?: bool = false`, `circular_y?: bool = false`, `posterior?: string = "sample"` | `tensor` |
|
|
| `vae_to_dit_latents` | `vae: vae`, `latent: tensor` | `tensor` |
|
|
| `vae_to_unet_latents` (alias of `vae_to_dit_latents`) | `vae: vae`, `latent: tensor` | `tensor` |
|
|
| `video::encode` | `video: dict`, `audio?: dict`, `format?: string = "webm"` | `dict`<br>`data: bytes`<br>`mime_type: string` |
|
|
| `video::join_windows` | `windows: list<tensor>`, `overlap?: int = 0` | `tensor` |
|
|
| `video::load` | `path: string`, `max_frames?: int = 0`, `fps_num?: int = 0`, `fps_den?: int = 1`, `audio?: bool = true` | `dict`<br>`audio: dict`<br>`audio.sample_rate: int`<br>`audio.samples: tensor`<br>`video: dict`<br>`video.fps_den: int`<br>`video.fps_num: int`<br>`video.frames: tensor` |
|
|
| `video::save` | `path: string`, `video: dict`, `audio?: dict`, `trim_audio?: bool = false`, `codec?: string = "auto"`, `quality?: int = 90`, `audio_format?: string = "f32"` | `void` |
|
|
| `video::split_windows` | `frames: tensor`, `size: int`, `overlap?: int = 0` | `list<tensor>` |
|
|
| `wan::s2v_audio_window` | `embedding: tensor`, `latent_frames: int` | `tensor` |
|
|
| `zero_out` | `condition: dict`, `fields?: list<string>` | same type as `condition` |
|
|
|
|
## Model family IDs
|
|
|
|
Pass the ID as the component loader's `family` argument. The default is `"auto"`.
|
|
|
|
| ID | Model family |
|
|
|---|---|
|
|
| `sd1` | SD 1.x |
|
|
| `sd1_inpaint` | SD 1.x Inpaint |
|
|
| `sd1_pix2pix` | Instruct-Pix2Pix |
|
|
| `sd1_tiny_unet` | SD 1.x Tiny UNet |
|
|
| `sd2` | SD 2.x |
|
|
| `sd2_inpaint` | SD 2.x Inpaint |
|
|
| `sd2_tiny_unet` | SD 2.x Tiny UNet |
|
|
| `sdxs_512_ds` | SDXS (512-DS) |
|
|
| `sdxs_09` | SDXS (09) |
|
|
| `sdxl` | SDXL |
|
|
| `sdxl_inpaint` | SDXL Inpaint |
|
|
| `sdxl_pix2pix` | SDXL Instruct-Pix2Pix |
|
|
| `sdxl_vega` | SDXL (Vega) |
|
|
| `sdxl_ssd1b` | SDXL (SSD1B) |
|
|
| `svd` | SVD |
|
|
| `sd3` | SD3.x |
|
|
| `flux` | Flux |
|
|
| `flux_fill` | Flux Fill |
|
|
| `flux_control` | Flux Control |
|
|
| `flex2` | Flex.2 |
|
|
| `chroma_radiance` | Chroma Radiance |
|
|
| `wan2` | Wan 2.x |
|
|
| `wan2_2_i2v` | Wan 2.2 I2V |
|
|
| `wan2_2_ti2v` | Wan 2.2 TI2V |
|
|
| `wan2_2_s2v` | Wan 2.2 S2V |
|
|
| `lingbot_video` | LingBot Video |
|
|
| `qwen_image` | Qwen Image |
|
|
| `qwen_image_layered` | Qwen Image Layered |
|
|
| `qwen_image_2_1` | Qwen Image 2.1 |
|
|
| `hunyuan_video` | Hunyuan Video |
|
|
| `anima` | Anima |
|
|
| `flux2` | Flux.2 |
|
|
| `flux2_klein` | Flux.2 klein |
|
|
| `ltxav` | LTXAV |
|
|
| `minimax_h3` | MiniMax-H3 |
|
|
| `hidream_o1` | HiDream O1 |
|
|
| `z_image` | Z-Image |
|
|
| `boogu_image` | Boogu Image |
|
|
| `ovis_image` | Ovis Image |
|
|
| `ernie_image` | Ernie Image |
|
|
| `lens` | Lens |
|
|
| `minit2i` | MiniT2I |
|
|
| `longcat_image` | Longcat-Image |
|
|
| `pid` | PiD |
|
|
| `ideogram4` | Ideogram 4 |
|
|
| `sefi_image` | SeFi-Image |
|
|
| `krea2` | Krea2 |
|
|
| `mage_flow` | Mage Flow |
|
|
| `sensenova_u1_5` | SenseNova U1.5 |
|
|
| `llada_image` | LLaDA-Image |
|
|
| `esrgan` | ESRGAN |
|
|
| `pixart` | PixArt |
|
|
| `ming_image` | Ming-Image |
|
|
| `z_image_l2p` | Z-Image L2P |
|
|
| `iris_3b` | Iris-3B |
|
|
| `flux3_klein` | Flux.3 Image Klein |
|
|
| `moss_image` | MOSS-Image |
|
|
| `fibo2` | Fibo-2.0 |
|
|
| `chroma` | Chroma |
|
|
| `p_h3_image` | P-H3-Image |
|
|
| `minimax_h3_image` | MiniMax-H3-Image |
|
|
| `relayvsr` | RelayVSR |
|
|
| `seedvr2` | SeedVR2 |
|