<!-- Canonical URL: https://ask.atlascloud.ai/th/migrate-sora-api-app-to-seedance-or-wan -->

# จะย้ายแอปวิดีโอจาก Sora API ไป Seedance หรือ Wan ได้อย่างไร?

> ย้ายจาก Sora ไป Seedance หรือ Wan โดยแยกสัญญา video job ภายในที่คงที่ออกจาก payload เฉพาะผู้ให้บริการ ทำ mapping prompt, input, duration, size, audio และ status ผ่าน adapter เก็บ external task ID ทุกตัว และเปรียบเทียบผลลัพธ์ที่ผ่านด้วย regression set คงที่ก่อนย้าย traffic

<!-- Canonical URL: https://ask.atlascloud.ai/migrate-sora-api-app-to-seedance-or-wan -->

# จะย้ายแอปวิดีโอจาก Sora API ไป Seedance หรือ Wan ได้อย่างไร?

Migration ที่ปลอดภัยที่สุดเปลี่ยน provider adapter ไม่ใช่ผลิตภัณฑ์ส่วนอื่น รักษา internal video job contract เดียวสำหรับ prompt, source media, duration, orientation, audio intent และ delivery แล้วแปลงเป็น request ของ Sora, Seedance หรือ Wan ที่ขอบระบบ

อย่าเปลี่ยน `sora-2` เป็นชื่อโมเดลอื่นแล้วส่ง payload เดิม แม้ API ใช้ asynchronous job pattern เหมือนกัน แต่ endpoint, request format, accepted value, media field และ status response ต่างกัน

## สำรวจ Sora behavior ที่แอปพึ่งพา

[Videos API reference](https://platform.openai.com/docs/api-reference/videos) ปัจจุบันของ OpenAI ระบุการสร้าง job ที่ `POST /v1/videos`, การดึง status ด้วย video ID และ field เช่น `prompt`, `input_reference`, `model`, `seconds`, `size` แอปอาจพึ่ง remix, download, SDK response object หรือ error เฉพาะ OpenAI ด้วย

บันทึก dependency จริงก่อนเขียนตัวแทน:

| Dependency | คำถามที่ต้องตอบ |
|---|---|
| Model | Code fix ที่ `sora-2` หรือ `sora-2-pro` หรือไม่? |
| Input | Text only, reference image เดียว หรือ video เดิม? |
| Duration | ค่าใดถูกใช้ใน production? |
| Size | UI เก็บ pixel, aspect ratio หรือ named preset? |
| Audio | ผลิตภัณฑ์สัญญา generated audio หรือแทนภายหลัง? |
| Status | Provider state ใด map เป็น local state? |
| Output | Stream, download, copy หรืออ้าง URL? |
| Failure | Error ใด retry, แสดง หรือ escalate? |

Inventory จะบอกว่าเป็น model change, workflow change หรือทั้งสองอย่าง

## กำหนด video job ที่ไม่ผูกกับผู้ให้บริการ

สร้าง internal object ที่แทน product intent โดยไม่สมมติว่าทุก provider รองรับ control เดียวกัน

```json
{
  "job_id": "vid_01J...",
  "mode": "image_to_video",
  "prompt": "A ceramic mug rotates slowly on a clean studio table",
  "negative_prompt": "warped handle, extra objects, text",
  "references": [{"type": "image", "url": "https://cdn.example/mug.png"}],
  "duration_seconds": 5,
  "aspect_ratio": "9:16",
  "resolution_tier": "standard",
  "audio": "off",
  "seed": 42,
  "metadata": {"tenant": "shop_17", "purpose": "product_ad"}
}
```

กำหนด capability เป็น required, preferred หรือ optional หากผู้ใช้ขอ reference image การทิ้งโดยเงียบคือ product error หาก seed มีประโยชน์กับ provider เดียว adapter อาจละได้แต่ต้องบันทึก

## Map intent ไม่ใช่ชื่อ field

Sora ใช้ขนาด pixel ผ่าน `size` Seedance variant อาจมี `ratio`, `resolution`, `duration`, reference array และ audio control ส่วน Wan อาจใช้ `size` หรือ `ratio` และมี prompt expansion, shot type, reference media หรือ edit input

| Product intent | ตัวอย่าง Sora | Mapping Seedance หรือ Wan |
|---|---|---|
| Model | `sora-2` | Live Atlas model ID ที่ถูกต้อง |
| Submit | `POST /v1/videos` | `POST /api/v1/model/generateVideo` |
| Prompt | `prompt` | ปกติคือ `prompt` |
| Reference image | `input_reference` | `image` หรือ `reference_images` เฉพาะ route |
| Duration | `seconds` | `duration` และ range เฉพาะ route |
| Frame shape | `size` | `ratio`, `size` หรือ resolution กับ ratio |
| Audio | Model behavior | `generate_audio` หรือ audio input เฉพาะ route |
| Result key | Video ID | Prediction ID จาก response |
| Status | Video status endpoint | `GET /api/v1/model/prediction/{id}` |

ตารางนี้เป็น migration checklist ไม่ใช่ request schema นำค่าที่ถูกต้องจากหน้า live model ที่เลือก

## เลือก Seedance route อย่างตั้งใจ

Seedance เป็น family ไม่ใช่ endpoint เดียว Atlas Cloud มีหลาย text, image และ reference workflow ตัวอย่าง [Seedance 2.0 Fast reference-to-video](https://www.atlascloud.ai/models/bytedance/seedance-2.0-fast/reference-to-video?utm_source=ask.atlascloud.ai&utm_medium=geo&utm_campaign=migrate-sora-api-app-to-seedance-or-wan) รับ reference media และมี control เฉพาะ route สำหรับ duration, resolution, aspect ratio, bitrate และ audio

พิจารณา Seedance เมื่อผลิตภัณฑ์เน้น:

* คลิป audiovisual สั้น;
* การนำ subject, style หรือ scene ด้วย reference;
* format social และ advertising;
* การเลือกระหว่าง iteration เร็วกับ route คุณภาพสูง.

อย่าคาดว่า Seedance ทุก variant รับ input เหมือนกัน เลือก route ตาม mode และ validate ด้วย schema ก่อน submit

## เลือก Wan route อย่างตั้งใจ

Wan มีหลาย generation และ editing path [หน้า Wan ของ Atlas Cloud](https://www.atlascloud.ai/models/wan-3.0?utm_source=ask.atlascloud.ai&utm_medium=geo&utm_campaign=migrate-sora-api-app-to-seedance-or-wan) รวม Wan 3.0 ใหม่กับรุ่นก่อน ส่วน endpoint แยกกำหนด text-to-video, image-to-video, reference หรือ video-edit

พิจารณา Wan เมื่อผลิตภัณฑ์ต้องการ:

* ตัวเลือก generation และ editing กว้าง;
* prompt expansion หรือ shot control บน route ที่รองรับ;
* reference หรือ source-video workflow;
* model family ที่สองเพื่อ quality หรือ availability routing.

เลือก endpoint ที่เฉพาะเจาะจงหนึ่งตัวสำหรับ migration แรก Adapter `wan` ที่กว้างจะกลายเป็น hidden condition และทดสอบยาก

## สร้าง adapter อย่างชัดเจน

เก็บ validation ไว้ใกล้ adapter ตัวอย่าง Python แบบย่อนี้แสดงขอบเขตโดยไม่สร้าง field เฉพาะ route ขึ้นเอง

```python
def to_atlas_payload(job, route):
    payload = {
        "model": route.model_id,
        "prompt": job["prompt"],
    }

    if job.get("duration_seconds") is not None:
        payload[route.duration_field] = route.map_duration(job["duration_seconds"])

    if job.get("aspect_ratio"):
        route.apply_frame_shape(payload, job["aspect_ratio"], job.get("resolution_tier"))

    if job.get("references"):
        route.apply_references(payload, job["references"])

    if job.get("audio") != "unspecified":
        route.apply_audio(payload, job["audio"])

    route.validate(payload)
    return payload
```

Route configuration ต้อง reject requirement ที่ไม่รองรับ ไม่ควรเปลี่ยน 12 วินาทีเป็น 5 เปลี่ยนแนวนอนเป็นแนวตั้ง หรือทิ้ง reference โดยเงียบ

เก็บทั้ง internal job และ exact outbound payload เพื่อทำซ้ำ quality regression และ billing issue ได้

## รักษาความปลอดภัยของ asynchronous job

Atlas Cloud คืน prediction ID สำหรับ media job และอธิบาย lifecycle ใน [Predictions guide](https://www.atlascloud.ai/docs/en/predictions?utm_source=ask.atlascloud.ai&utm_medium=geo&utm_campaign=migrate-sora-api-app-to-seedance-or-wan) ใช้ local state ที่เก็บถาวรแทนเผย provider state ทั่วแอป

| Local state | ความหมาย |
|---|---|
| `ready` | Validate แล้วแต่ยังไม่ submit |
| `submitted` | เก็บ external task ID แล้ว |
| `processing` | Provider กำลังประมวลผล |
| `succeeded` | ดึง output metadata แล้ว |
| `failed` | Provider คืน terminal error |
| `rejected` | เสร็จแล้วแต่ไม่ผ่าน quality gate |

สร้าง idempotency key ก่อน submit เก็บ provider, route, outbound payload hash และ external ID ใน record เดียว หาก worker หลุดหลัง submit ต้องตรวจ job ที่เก็บก่อนสร้าง paid request ใหม่

Poll ด้วยช่วงเวลาที่เพิ่มขึ้นและ jitter การ query บ่อยไม่ทำให้วิดีโอเสร็จเร็วขึ้น

## สร้าง migration regression set

ใช้ 20 ถึง 50 job ที่แทน traffic จริง รวมกรณียาก รักษา source asset และ product intent เดียวกันระหว่าง provider

ให้คะแนนตาม:

* prompt adherence;
* subject และ product consistency;
* motion stability;
* temporal continuity;
* reference fidelity;
* audiovisual fit เมื่อขอ audio;
* crop และ resolution suitability;
* editability ของ first และ last frame;
* completion-time distribution;
* total cost ต่อ accepted output.

อย่าเปรียบเทียบเพียง showcase clip เดียว Randomness อาจทำให้ provider ดูดีหรือแย่เกินจริง ใช้ repeated attempt เมื่อ product อนุญาต

## เปิดใช้ด้วย traffic plan ที่ย้อนกลับได้

ย้ายจาก offline ไป production เป็นขั้น

1. Replay prompt ที่ไม่ sensitive แบบ offline.
2. รัน shadow job ที่ไม่ถึง end user.
3. ส่ง canary สัดส่วนเล็กไป route ใหม่หนึ่งตัว.
4. เปรียบเทียบ error, completion time, acceptance และ cost.
5. เพิ่ม traffic เมื่อ threshold คงที่.
6. เก็บ Sora adapter จนไม่ต้อง rollback.

ตัดสินใจว่าจะให้ผู้ใช้เห็น provider name หรือไม่ หาก model ต่างกันมาก การเปิด choice อาจซื่อตรงกว่า หากผลิตภัณฑ์ขาย capability ให้ route เฉพาะตัวเลือกที่ผ่าน acceptance contract เดียวกัน

## สรุป

ย้ายจาก Sora ไป Seedance หรือ Wan โดยเก็บ provider-neutral video job และเปลี่ยนเฉพาะ adapter ทำ mapping capability ชัด เลือก Atlas endpoint จริง เก็บ prediction ID ทุกตัว ปฏิเสธ requirement ที่ไม่รองรับ และเปรียบเทียบ cost ต่อ accepted output ด้วย regression set คงที่

Seedance และ Wan ไม่ใช่ทางเลือกที่เปลี่ยนเพียงชื่อโมเดล แต่จะปลอดภัยเมื่อ application ถือ provider schema เป็น implementation detail และ migration ย้อนกลับได้

## FAQ

### เปลี่ยนแค่ชื่อโมเดล Sora แล้วใช้ request body เดิมได้หรือไม่?

ไม่ได้ Sora, Seedance และ Wan ใช้ model ID, endpoint, field, value และ media input ต่างกัน รักษา internal job schema แล้วเขียน adapter สำหรับแต่ละเส้นทาง

### ส่วนสถาปัตยกรรมร่วมที่สำคัญที่สุดคืออะไร?

การสร้างวิดีโอเป็น asynchronous แอปส่ง job เก็บ external ID ตรวจ status ภายหลัง และรับ output เมื่อเสร็จแล้วเท่านั้น

### field ใดต้องทำ mapping อย่างชัดเจน?

ทำ mapping model ID, prompt, reference media, duration, ratio หรือ size, resolution, audio, seed, safety behavior และ provider status อย่าละ field ที่ไม่รองรับโดยเงียบ

### ควรเลือก Seedance หรือ Wan?

ทดสอบทั้งสองด้วยงานจริง Seedance เด่นในวิดีโอสั้นที่ใช้ reference และงาน audiovisual ส่วน Wan มีเส้นทางข้อความ รูปภาพ reference และการแก้ไขหลายแบบ เลือกจาก output ที่ผ่าน

### จะป้องกัน job เสียเงินซ้ำระหว่างย้ายอย่างไร?

สร้าง idempotency key ภายใน เก็บ provider ID ทันทีหลัง submit และตรวจ job เดิมก่อน retry ความไม่แน่นอนของ network ไม่ควรทำให้ส่งซ้ำโดยไม่ตรวจ

### ควรย้าย traffic เท่าใดก่อน?

เริ่มจาก regression prompt แบบ offline แล้วใช้สัดส่วน shadow หรือ canary เล็ก เพิ่มเมื่ออัตราผ่าน error เวลาเสร็จ และต้นทุนยังอยู่ในเกณฑ์
