Chỉnh sửa ảnh chính xác được hỗ trợ bởi Google Gemini 3.0 Pro API với đầu ra 2K/4K gốc. Cung cấp các chỉnh sửa cục bộ đáng tin cậy và độ ổn định cao với chi phí mỗi yêu cầu phải chăng.
Thử ngay AI tạo ảnh
API Nano Banana Pro Edit của Google (được hỗ trợ bởi mô hình Gemini 3.0 Pro Image) mang lại khả năng chỉnh sửa ảnh AI cấp sản xuất, tiết kiệm chi phí cho các nhà phát triển và nhóm sáng tạo. Tích hợp API chỉnh sửa ảnh Gemini cao cấp này giúp bạn chuyển đổi hình ảnh hiện có thành đầu ra độ phân giải cao lên đến 4K thông qua hướng dẫn ngôn ngữ tự nhiên. Mô hình Gemini cung cấp khả năng suy luận ngữ nghĩa cho các chỉnh sửa phức tạp, trong khi API cung cấp tích hợp ổn định cho quy trình làm việc có thể mở rộng trên Best Image AI.
Lưu Ý Vui lòng đảm bảo các prompt của bạn tuân thủ Hướng Dẫn An Toàn của Google. Nếu xảy ra lỗi, hãy xem xét prompt của bạn để tìm nội dung bị hạn chế, điều chỉnh nó và thử lại.
// Step 1: Submit generation request
// width and height must be aspect-ratio integers such as 16 and 9,
// not pixel dimensions like 768 and 1280.
// Currently all width/height values are passed as ratio integers,
// and the backend does not support custom pixel dimensions for these fields.
const response = await fetch('https://api.flaq.ai/api/v1/image/task', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
},
body: JSON.stringify({
model_name: 'nano-banana-pro-edit',
prompt: 'Transform this image into a watercolor painting style',
width: 16, // Aspect-ratio value, not pixel width
height: 9, // Aspect-ratio value, not pixel height
resolution: '2k', // Supported values: '1k', '2k', '4k'
image_url_list: [
'https://example.com/image1.jpg',
'https://example.com/image2.jpg'
]
})
});
const { data } = await response.json();
const taskId = data.task_id;
// Step 2: Poll for results
const taskId = data.task_id;
const pollResult = async (taskId) => {
const res = await fetch(`https://api.flaq.ai/api/v1/image/${taskId}`, {
headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
});
return res.json();
};
while (true) {
const pollResultData = await pollResult(taskId);
const status = pollResultData.data.task_status;
if (status === 'succeed') {
console.log(pollResultData.data.task_result.images[].);
;
}
(status === ) {
.(pollResultData..);
;
}
( (resolve, ));
}
# Step 1: Submit generation request
import requests
response = requests.post(
'https://api.flaq.ai/api/v1/image/task',
headers={
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
},
json={
'model_name': 'nano-banana-pro-edit',
'prompt': 'Transform this image into a watercolor painting style',
'width': 16, # Aspect-ratio value, not pixel width
'height': 9, # Aspect-ratio value, not pixel height
'resolution': '2k', # Supported values: '1k', '2k', '4k'
'image_url_list': [
'https://example.com/image1.jpg',
'https://example.com/image2.jpg'
]
}
)
result = response.json()
task_id = result['data']['task_id']
# Step 1: Submit generation request
curl -X POST https://api.flaq.ai/api/v1/image/task \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model_name": "nano-banana-pro-edit",
"prompt": "Transform this image into a watercolor painting style",
"width": 16,
"height": 9,
"resolution": "2k",
"image_url_list": [
"https://example.com/image1.jpg",
"https://example.com/image2.jpg"
]
}'
# Step 2: Poll for results
# Replace {task_id} with the task_id returned from the submit response
curl -X GET "https://api.flaq.ai/api/v1/image/{task_id}" \
-H "Authorization: Bearer YOUR_API_KEY"
# Step 2: Poll for results
task_id = response.json()['data']['task_id']
poll_url = f"https://api.flaq.ai/api/v1/image/{task_id}"
while True:
poll_result = requests.get(poll_url, headers={'Authorization': 'Bearer YOUR_API_KEY'}).json()
status = poll_result['data']['task_status']
if status == 'succeed':
print(poll_result['data']['task_result']['images'][0]['url'])
break
if status == 'failed':
print(poll_result['data']['task_status_msg'])
break
time.sleep(10)