dreamina-video-first-end-frame
3
总安装量
3
周安装量
#59172
全站排名
安装命令
npx skills add https://github.com/benzema216/dreamina-claude-skills --skill dreamina-video-first-end-frame
Agent 安装分布
opencode
2
claude-code
2
replit
1
trae
1
kimi-cli
1
Skill 文档
é¦å°¾å¸§çè§é¢å·¥å ·
API 端ç¹
POST https://jimeng.jianying.com/mweb/v1/aigc_draft/generate
Python 示ä¾
import requests
import hashlib
import time
import uuid
import json
def generate_sign(uri_path):
device_time = int(time.time())
sign_str = f"9e2c|{uri_path[-7:]}|7|5.8.0|{device_time}||11ac"
sign = hashlib.md5(sign_str.encode()).hexdigest()
return sign, device_time
def first_end_frame_to_video(sessionid, first_image_uri, last_image_uri, prompt="", ratio="16:9", duration=5):
uri = "/mweb/v1/aigc_draft/generate"
sign, device_time = generate_sign(uri)
RATIO_VALUES = {"16:9": 1, "9:16": 6, "1:1": 8, "4:3": 3, "3:4": 4}
component_id = str(uuid.uuid4())
image_ratio = RATIO_VALUES.get(ratio, 1)
draft_content = {
"type": "draft",
"id": str(uuid.uuid4()),
"min_version": "3.3.8",
"is_from_tsn": True,
"version": "3.3.8",
"main_component_id": component_id,
"component_list": [{
"type": "video_base_component",
"id": component_id,
"min_version": "3.3.8",
"metadata": {
"type": "",
"id": str(uuid.uuid4()),
"created_platform": 3,
"created_time_in_ms": int(time.time() * 1000)
},
"generate_type": "start_end_to_video",
"aigc_mode": "workbench",
"abilities": {
"type": "",
"id": str(uuid.uuid4()),
"start_end_to_video": {
"type": "",
"id": str(uuid.uuid4()),
"core_param": {
"type": "",
"id": str(uuid.uuid4()),
"prompt": prompt,
"video_ratio": image_ratio,
"duration": duration * 1000,
"resolution": "1080p"
},
"first_frame_image": {
"type": "image",
"id": str(uuid.uuid4()),
"source_from": "upload",
"platform_type": 1,
"image_uri": first_image_uri,
"uri": first_image_uri
},
"last_frame_image": {
"type": "image",
"id": str(uuid.uuid4()),
"source_from": "upload",
"platform_type": 1,
"image_uri": last_image_uri,
"uri": last_image_uri
},
"history_option": {"type": "", "id": str(uuid.uuid4())}
}
}
}]
}
headers = {
"Content-Type": "application/json",
"Appid": "513695",
"Appvr": "5.8.0",
"Pf": "7",
"Origin": "https://jimeng.jianying.com",
"Referer": "https://jimeng.jianying.com",
"Cookie": f"sessionid={sessionid}",
"Device-Time": str(device_time),
"Sign": sign,
"Sign-Ver": "1"
}
data = {
"extend": {},
"submit_id": str(uuid.uuid4()),
"draft_content": json.dumps(draft_content),
"http_common_info": {"aid": 513695}
}
resp = requests.post(
f"https://jimeng.jianying.com{uri}",
params={"aid": 513695, "device_platform": "web", "region": "CN", "da_version": "3.3.8"},
headers=headers,
json=data
)
return resp.json()
åæ°è¯´æ
| åæ®µ | ç±»å | å¿ å¡« | 说æ |
|---|---|---|---|
| first_image_uri | string | æ¯ | é¦å¸§å¾ç URI |
| last_image_uri | string | æ¯ | 尾帧å¾ç URI |
| prompt | string | å¦ | ååæè¿° |
| ratio | string | å¦ | è§é¢æ¯ä¾ï¼é»è®¤ 16:9 |
| duration | int | å¦ | æ¶é¿ç§æ° 3-10ï¼é»è®¤ 5 |
ååç±»åæè¿°
- 空é´åæ¢ï¼ç¬¬ä¸äººç§°è§è§ã俯å²é头ã360°ç¯ç»ã稳å®å¨è·æ
- 身份ååï¼é头æ¨è¿ãçé¾ç¼ç»ãå½¢ææ¸å
- è§è²å¨æï¼è·é主ä½è¿å¨ãå¨ä½è¿è´¯
注æ
- çéæè¿°ç»é¢ååï¼æ éæè¿°åå§å¾çå 容
- é¦å°¾å¸§éè¦æè§è§ä¸çè¿è´¯æ§
ä½¿ç¨æµç¨
- ä¸ä¼ é¦å¸§å尾帧å¾çè·å
image_uri - è°ç¨é¦å°¾å¸§çè§é¢ API
- 轮询æ¥è¯¢ç»æ
- ä¸è½½è§é¢æä»¶