> For the complete documentation index, see [llms.txt](https://docs.trendswap.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.trendswap.app/core-engine/seedance-architecture.md).

# seedance architecture

TrendSwap is powered by a production-tuned deployment of the **Seedance 2.5 Multi-Reference Generative Video Engine**. The engine is built upon multi-modal diffusion transformer models optimized specifically for temporal coherence and character retargeting.

***

## Neural Pipeline Overview

Unlike classical deep learning methods that operate solely on 2D image-to-image translations, Seedance 2.5 decouples the generative task into three orthogonal latent pathways:

```
[ Input Image @Image 1 ] ---> Latent Identity Encoder (ID Latents)                                                                      ===> Latent Diffusion Transformer (DiT) ===> VAE Decoder ===> Output Video
[ Motion Video @Video 1 ] ---> Motion Vector Extractor (Pose Latents) /
[ Text Prompt / Tags ]    ---> CLIP / T5 Text Conditioning (Context)  /
```

{% stepper %}
{% step %}

## Latent Identity Extraction

The user's portrait (`@Image 1`) is mapped into a rich identity embedding space that captures:

* 3D facial mesh coordinates and landmark geometry.
* High-frequency skin texture, eye iris pigmentation, and hair contour features.
* Volumetric lighting and skin reflectance properties.
  {% endstep %}

{% step %}

## Spatio-Temporal Motion Retargeting

The reference template (`@Video 1`) supplies temporal motion cues, including:

* Skeletal kinematic keypoints and joint velocity.
* Camera 6-DOF tracking (pan, tilt, zoom, handheld camera shake).
* Global scene illumination fluctuations (e.g. flickering banquet candles, lightning flashes).
  {% endstep %}

{% step %}

## Parameter Separation Rule

Operational parameters (duration, resolution, framing ratio) are never injected as textual prompt tags. Instead, they are passed as deterministic tensor shape arguments directly into the neural execution graph, preventing model hallucination.
{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.trendswap.app/core-engine/seedance-architecture.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
