Chỉnh sửa hình ảnh

Ideogram Character — remix

Ideogram Character — remix qua API MegaBrain (Chỉnh sửa hình ảnh): $0.072 mỗi hình ảnh. Một khóa cho mọi mô hình, trả từ số dư trả trước bằng đô la, không cần gói đăng ký.

ideogram/character/remix
Giá
$0.072
mỗi hình ảnh

Trừ khi tác vụ vào hàng đợi, hoàn lại nếu tạo không thành công.

Kết quả mẫu

Dùng thử trên trình duyệt

Sau khi đăng nhập, playground trên trang tiếng Anh chạy Ideogram Character — remix ngay trong trình duyệt, trả từ cùng số dư với API.

Mở playground

Tham số yêu cầu

Các trường trong phần thân JSON của yêu cầu. Mô hình không nhận trường nào khác: yêu cầu có chúng sẽ nhận lỗi 400.

  • promptchuỗibắt buộc
  • image_urlURLbắt buộc
  • image_urlsdanh sách URLtùy chọn
    Tối đa 5 mục
  • reference_image_urlsdanh sách URLbắt buộc
    Tối đa 1 mục
  • rendering_speedchuỗitùy chọn
    Mặc định:
    BALANCED
    Giá trị:
    TURBO, BALANCED, QUALITY
  • stylechuỗitùy chọn
    Mặc định:
    AUTO
    Giá trị:
    AUTO, REALISTIC, FICTION
  • expand_prompttrue / falsetùy chọn
  • image_sizechuỗitùy chọn
    Mặc định:
    square_hd
    Giá trị:
    square, square_hd, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9
  • seedsố nguyêntùy chọn
  • strengthsốtùy chọn
    Mặc định:
    0.8
    Khoảng:
    0.1–1
  • negative_promptchuỗitùy chọn

Dùng qua API

Gửi tác vụ, kiểm tra status_url đến khi có trạng thái COMPLETED, rồi lấy kết quả từ response_url. Cùng khóa và số dư dùng được cho các mô hình văn bản. Tài liệu API (tiếng Anh)

curl

curl -X POST https://getmegabrain.com/api/gateway/v1/queue/ideogram/character/remix \
  -H "Authorization: Bearer $MEGABRAIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"a ceramic coffee mug on a sunlit oak table, product photo","image_url":"https://example.com/photo.jpg","reference_image_urls":["https://example.com/reference.jpg"]}'

# Then poll status_url and fetch the result from response_url:
curl https://getmegabrain.com/api/gateway/v1/queue/requests/$REQUEST_ID -H "Authorization: Bearer $MEGABRAIN_API_KEY"

Python

import os, time, requests

BASE = "https://getmegabrain.com/api/gateway/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['MEGABRAIN_API_KEY']}"}

job = requests.post(f"{BASE}/queue/ideogram/character/remix", headers=HEADERS, json={
  "prompt": "a ceramic coffee mug on a sunlit oak table, product photo",
  "image_url": "https://example.com/photo.jpg",
  "reference_image_urls": [
    "https://example.com/reference.jpg"
  ]
}).json()

while requests.get(job["status_url"], headers=HEADERS).json()["status"] not in ("COMPLETED", "FAILED"):
    time.sleep(2)

print(requests.get(job["response_url"], headers=HEADERS).json())

JavaScript

const BASE = 'https://getmegabrain.com/api/gateway/v1';
const headers = {
  Authorization: `Bearer ${process.env.MEGABRAIN_API_KEY}`,
  'Content-Type': 'application/json',
};

const job = await fetch(`${BASE}/queue/ideogram/character/remix`, {
  method: 'POST',
  headers,
  body: JSON.stringify({
    "prompt": "a ceramic coffee mug on a sunlit oak table, product photo",
    "image_url": "https://example.com/photo.jpg",
    "reference_image_urls": [
      "https://example.com/reference.jpg"
    ]
  }),
}).then(r => r.json());

let status = job.status;
while (status !== 'COMPLETED' && status !== 'FAILED') {
  await new Promise(r => setTimeout(r, 2000));
  ({ status } = await fetch(job.status_url, { headers }).then(r => r.json()));
}
console.log(await fetch(job.response_url, { headers }).then(r => r.json()));

Câu hỏi thường gặp

API Ideogram Character — remix giá bao nhiêu?

$0.072 mỗi hình ảnh. Chi phí được trừ vào số dư trả trước bằng đô la, và lần tạo không thành công được hoàn tiền đầy đủ. Không có gói đăng ký.

Làm sao dùng Ideogram Character — remix qua API?

Gửi tác vụ bằng POST https://getmegabrain.com/api/gateway/v1/queue/ideogram/character/remix với khóa API MegaBrain của bạn, kiểm tra status_url đến khi có trạng thái COMPLETED, rồi lấy kết quả từ response_url. Cùng khóa và số dư dùng được cho các mô hình văn bản.

Có thể dùng thử Ideogram Character — remix mà không viết mã không?

Có: sau khi đăng nhập, playground trên trang tiếng Anh của mô hình chạy Ideogram Character — remix ngay trong trình duyệt, trả từ cùng số dư với API.

Ideogram Character — remix có nhận hình ảnh đầu vào không?

Có: gửi hình ảnh gốc trong image_url (URL hình ảnh) và mô tả thay đổi trong prompt.