Image to Image API เป็นฟีเจอร์ที่ช่วยให้คุณสามารถผสานรวมความสามารถในการแก้ไขรูปภาพด้วย AI ของ Meshy เข้ากับแอปพลิเคชันของคุณเองได้ เปลี่ยนรูปแบบและแก้ไขรูปภาพที่มีอยู่โดยใช้รูปภาพอ้างอิงและข้อความพรอมต์ด้วยโมเดล AI อันทรงพลังของเรา
เอนด์พอยต์นี้ช่วยให้คุณสร้างงาน Image to Image ใหม่ได้ ดูข้อมูลเพิ่มเติมที่
The Image to Image Task Object เพื่อดูว่า object งาน Image to Image มีพร็อพเพอร์ตี้ใดบ้าง
งานนี้ทำงานอยู่เบื้องหลัง สำหรับระยะเวลาที่มักใช้ ดูได้ที่ Processing Times
ID ของงานสร้างรูปภาพที่เสร็จสมบูรณ์แล้ว ซึ่งรูปภาพผลลัพธ์ของงานนั้นจะถูกนำมาใช้เป็นรูปภาพอ้างอิง งานนี้ต้องเป็นหนึ่งในงานต่อไปนี้: Text to Image หรือ Image to Image รวมถึงรูปแบบมุมมองหลายด้านของงานเหล่านั้นด้วย นอกจากนี้ งานดังกล่าวต้องถูกรันผ่าน API และมีสถานะเป็น SUCCEEDED
# Transform a reference image with a text promptcurlhttps://api.meshy.ai/openapi/v1/image-to-image \-XPOST \-H"Authorization: Bearer ${YOUR_API_KEY}" \-H'Content-Type: application/json' \-d'{ "ai_model": "nano-banana", "prompt": "Transform this into a cyberpunk style artwork", "reference_image_urls": [ "<your publicly accessible image url or base64-encoded data URI>" ] }'## Using Data URI examplecurlhttps://api.meshy.ai/openapi/v1/image-to-image \-XPOST \-H"Authorization: Bearer ${YOUR_API_KEY}" \-H'Content-Type: application/json' \-d'{ "ai_model": "nano-banana", "prompt": "Transform this into a cyberpunk style artwork", "reference_image_urls": [ "data:image/png;base64,${YOUR_BASE64_ENCODED_IMAGE_DATA}" ] }'## Chaining from a previous task, instead of passing image URLscurlhttps://api.meshy.ai/openapi/v1/image-to-image \-XPOST \-H"Authorization: Bearer ${YOUR_API_KEY}" \-H'Content-Type: application/json' \-d'{ "ai_model": "nano-banana", "prompt": "Transform this into a cyberpunk style artwork", "input_task_id": "<your Text to Image or Image to Image task id>" }'
เอนด์พอยต์นี้ช่วยให้คุณสามารถดึงข้อมูล Image to Image task โดยใช้ task id ที่ถูกต้อง
ดู The Image to Image Task Object เพื่อดูว่ามีคุณสมบัติใดบ้างที่รวมอยู่ใน Image to Image task object
พารามิเตอร์
Name
id
Type
path
Description
ตัวระบุที่ไม่ซ้ำกันสำหรับ Image to Image task ที่ต้องการดึงข้อมูล
{"id":"018a210d-8ba4-705c-b111-1f1776f7f578","type":"image-to-image","ai_model":"nano-banana","prompt":"Transform this into a cyberpunk style artwork","status":"SUCCEEDED","progress":100,"created_at":1692771650657,"started_at":1692771667037,"finished_at":1692771669037,"expires_at":1692771679037,"image_urls": ["https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/image.png?Expires=***" ]}
// 200 OK on success, with an empty body.//// 409 Conflict when the task is IN_PROGRESS — the task is left running:{"message":"Task is IN_PROGRESS and cannot be deleted. Credits for a task the worker has already started are not refundable; wait for it to reach SUCCEEDED, FAILED or CANCELED, then delete it."}
[ {"id":"018a210d-8ba4-705c-b111-1f1776f7f578","type":"image-to-image","ai_model":"nano-banana","prompt":"Transform this into a cyberpunk style artwork","status":"SUCCEEDED","progress":100,"created_at":1692771650657,"started_at":1692771667037,"finished_at":1692771669037,"expires_at":1692771679037,"image_urls": ["https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/image.png?Expires=***" ] }]
{"id":"018a210d-8ba4-705c-b111-1f1776f7f578","type":"image-to-image","ai_model":"nano-banana","prompt":"Transform this into a cyberpunk style artwork","status":"SUCCEEDED","progress":100,"created_at":1692771650657,"started_at":1692771667037,"finished_at":1692771669037,"expires_at":1692771679037,"preceding_tasks":0,"image_urls": ["https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/image.png?Expires=***" ],"task_error": {"message":"" },"consumed_credits":3}