Bỏ qua đến nội dung

Recraft V4.1 Text to Image

Tích hợp

Id mô hình recraft/v4.1/text-to-image
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/recraft/v4.1/text-to-image?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Full-body fashion shot with the character framed in a close-up, cropped from mid-thigh or waist up so the figure dominates the composition, neutral pose, muted outfit, solid grey background (flat, no gradient). Minimal scribbles with one large graphic element (e.g. oversized abstract shape or drawn eye) placed behind and partially overlapping the figure. Bold oversized typography integrated tightly around the subject: '\''MAKE IT BREAK / MAKE IT WORK'\'' (large serif, slightly distorted, crossing the upper body), '\''no perfect version exists'\'' (small subtle line). Add stickers: minimal icons, checkmarks, soft scribbles, small tape details. Clean but expressive editorial chaos, focus on the character."
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Yêu cầu này: 0,035 $ 35 tín dụng API · ≈ 3,77 ₽ Chạy trên trang này

Lấy khóa API
Recraft Văn bản sang hình ảnh #design#brand-colors#illustration

Mô hình ảnh định hướng thiết kế với bảng màu thương hiệu và khả năng điều khiển màu nền.

Ví dụ

Đầu ra · ~27 s
Full-body fashion shot with the character framed in a close-up, cropped from mid-thigh or waist up so the figure domi...

Lời nhắcFull-body fashion shot with the character framed in a close-up, cropped from mid-thigh or waist up so the figure dominates the composition, neutral pose, muted outfit, solid grey background (flat, no gradient). Minimal scribbles with one large graphic element (e.g. oversized abstract shape or drawn eye) placed behind and partially overlapping the figure. Bold oversized typography integrated tightly around the subject: 'MAKE IT BREAK / MAKE IT WORK' (large serif, slightly distorted, crossing the upper body), 'no perfect version exists' (small subtle line). Add stickers: minimal icons, checkmarks, soft scribbles, small tape details. Clean but expressive editorial chaos, focus on the character.

0,035 $ · 35 tín dụng API

Lời nhắc từ @recraftai trên X

Tạo một yêu cầu

Các điều khiển được tạo từ lược đồ mô hình. Mã và giá sẽ cập nhật khi bạn thay đổi chúng.

•bắt buộc 700 / 10000
image_size mặc định square_hd
Nâng cao colors · background_color
mặc định []

Mảng chứa các màu ưu tiên.

Màu ưu tiên cho nền của hình ảnh được tạo.

POST /run/recraft/v4.1/text-to-image?wait=20 báo giá → 0,035 $
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/recraft/v4.1/text-to-image?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Full-body fashion shot with the character framed in a close-up, cropped from mid-thigh or waist up so the figure dominates the composition, neutral pose, muted outfit, solid grey background (flat, no gradient). Minimal scribbles with one large graphic element (e.g. oversized abstract shape or drawn eye) placed behind and partially overlapping the figure. Bold oversized typography integrated tightly around the subject: '\''MAKE IT BREAK / MAKE IT WORK'\'' (large serif, slightly distorted, crossing the upper body), '\''no perfect version exists'\'' (small subtle line). Add stickers: minimal icons, checkmarks, soft scribbles, small tape details. Clean but expressive editorial chaos, focus on the character."
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Chạy yêu cầu này

Key của bạn vẫn nằm trong trình duyệt này: key chỉ được gửi đến Doitong API và chỉ được lưu trong localStorage nếu bạn chọn Ghi nhớ. Nhận khóa API

Giới thiệu về Recraft V4.1 Text to Image

Recraft V4.1 được xây dựng cho công việc thiết kế: hình ảnh tiếp thị, hình minh họa và cảnh sản phẩm với bố cục rõ ràng. Truyền danh sách màu RGB mong muốn để duy trì bảng màu thương hiệu hoặc cố định màu nền cho các bộ ảnh nhất quán. Mỗi yêu cầu tạo một ảnh với kích thước đặt sẵn hoặc tùy chỉnh.

Tham số

TênKiểu Mặc địnhĐược phép Mô tả
promptbắt buộc
Kiểustring
≤ 10.000 ký tự
image_sizetùy chọn
Kiểuobject
Mặc địnhsquare_hd
square_hdsquareportrait_4_3portrait_16_9landscape_4_3landscape_16_9
colorstùy chọn
Kiểuobject[]
Mặc định[]
Mảng chứa các màu ưu tiên.
colors[].rtùy chọn
Kiểuinteger
Mặc định0
0 – 255
Giá trị của thành phần màu đỏ.
colors[].gtùy chọn
Kiểuinteger
Mặc định0
0 – 255
Giá trị của thành phần màu xanh lá.
colors[].btùy chọn
Kiểuinteger
Mặc định0
0 – 255
Giá trị của thành phần màu xanh dương.
background_colortùy chọn
Kiểuobject
Màu ưu tiên cho nền của hình ảnh được tạo.
background_color.rtùy chọn
Kiểuinteger
Mặc định0
0 – 255
Giá trị của thành phần màu đỏ.
background_color.gtùy chọn
Kiểuinteger
Mặc định0
0 – 255
Giá trị của thành phần màu xanh lá.
background_color.btùy chọn
Kiểuinteger
Mặc định0
0 – 255
Giá trị của thành phần màu xanh dương.
bắt buộc

Đầu ra

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "recraft/v4.1/text-to-image",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 35,
    "usd": "0.035",
    "charged": 35,
    "refunded": 0
  },
  "input": {
    "prompt": "Tilt-shift miniature view of a fishing village harbor at golden hour, colorful boats, toy-like scale",
    "image_size": "landscape_16_9"
  },
  "output": {
    "images": [
      {
        "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
        "content_type": "image/jpeg",
        "file_name": "0-output.jpeg",
        "file_size": 1843200
      }
    ]
  },
  "outputs": [
    {
      "type": "image",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_size": 1843200,
      "width": 1024,
      "height": 768,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
Tệp của bạn, lựa chọn của bạnMỗi outputs[].url là một bản sao trên bộ lưu trữ của chúng tôi: được giữ vĩnh viễn (tính phí theo GB-tháng) hoặc 7 ngày miễn phí, theo cài đặt tài khoản hoặc ?storage=.
Cùng một cấu trúc trên mọi mô hìnhtype, url, content_type, width, height và duration cho hình ảnh, video và âm thanh. output là đối tượng kết quả riêng của mô hình.
Các trường đầu ra
images
array of object {url, content_type, file_name, file_size}

Thêm mô hình: Văn bản sang hình ảnh

Dành cho tác nhân AI: trang này ở dạng Markdown tại https://doitong.com/vi/developers/models/recraft/v4.1/text-to-image.md. Tất cả mô hình và hướng dẫn: https://doitong.com/developers/llms.txt