dreamina-super-resolution
3
总安装量
3
周安装量
#57753
全站排名
安装命令
npx skills add https://github.com/benzema216/dreamina-claude-skills --skill dreamina-super-resolution
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 super_resolution(sessionid, image_uri, resolution_type="4k", detail_strength=0.5):
"""
æºè½è¶
æ¸
- å°å¾çæ¾å¤§å° 4K å辨ç
Args:
sessionid: ç»å½ sessionid
image_uri: è¾å
¥å¾ç URI (éè¿ upload_image è·å)
resolution_type: "2k" æ "4k"ï¼é»è®¤ "4k"
detail_strength: ç»èçæç¨åº¦ 0-1ï¼é»è®¤ 0.5
"""
uri = "/mweb/v1/aigc_draft/generate"
sign, device_time = generate_sign(uri)
component_id = str(uuid.uuid4())
submit_id = str(uuid.uuid4())
draft_content = {
"type": "draft",
"id": str(uuid.uuid4()),
"min_version": "3.2.8",
"min_features": ["AIGC_GenerateType_ProHD"],
"is_from_tsn": True,
"version": "3.3.8",
"main_component_id": component_id,
"component_list": [{
"type": "image_base_component",
"id": component_id,
"min_version": "3.0.2",
"aigc_mode": "workbench",
"metadata": {
"type": "",
"id": str(uuid.uuid4()),
"created_platform": 3,
"created_time_in_ms": str(int(time.time() * 1000))
},
"generate_type": "pro_hd",
"abilities": {
"type": "",
"id": str(uuid.uuid4()),
"pro_hd": {
"type": "",
"id": str(uuid.uuid4()),
"resolution_type": resolution_type,
"hd_scene_type": "auto",
"original_image_strength": 0.65,
"detail_strength": detail_strength,
"postedit_param": {
"type": "",
"id": str(uuid.uuid4()),
"generate_type": 35,
"origin_image": {
"type": "image",
"id": str(uuid.uuid4()),
"source_from": "upload",
"platform_type": 1,
"image_uri": image_uri,
"uri": image_uri
}
}
}
}
}]
}
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": submit_id,
"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",
"web_version": "7.5.0"
},
headers=headers,
json=data
)
return resp.json()
åæ°è¯´æ
| åæ®µ | ç±»å | å¿ å¡« | 说æ |
|---|---|---|---|
| image_uri | string | æ¯ | è¾å ¥å¾ç URI (éè¿ upload_image è·å) |
| resolution_type | string | å¦ | 2k æ 4kï¼é»è®¤ 4k |
| detail_strength | float | å¦ | ç»èçæç¨åº¦ 0-1ï¼é»è®¤ 0.5 |
å ³é®åæ°
- generate_type:
pro_hd - gen_type:
35 - hd_scene_type:
auto(èªå¨éæ©åºæ¯)
ä½¿ç¨æµç¨
- ä¸ä¼ å¾çè·å
image_uri(è§ dreamina-upload-image) - è°ç¨æºè½è¶ æ¸ API
- 轮询æ¥è¯¢ç»æ (è§ dreamina-query-result)
- ä¸è½½é«æ¸ å¾ç