API tạo ảnh từ văn bản

API AI dành cho nhà phát triển

API tạo ảnh từ văn bản

Xây dựng tính năng tạo hình ảnh AI vào sản phẩm của bạn bằng API chuyển văn bản thành hình ảnh PoYo. So sánh các mô hình hình ảnh, điều khiển lời nhắc, kích thước đầu ra và giá cả cho các ứng dụng sáng tạo và quy trình làm việc tự động.

Các mô hình phù hợp

Các mô hình 37

Nano Banana Pro
Văn bản sang hình ảnh

$0.04 /lần tạo

nano-banana-pro

Google's advanced Gemini 3 Pro image model featuring 4K resolution, enhanced reasoning, real-time data integration, and multi-image composition capabilities.

GPT Image 2
Văn bản sang hình ảnh

$0.01 /lần tạo

gpt-image-2

OpenAI's premium image generation family for text-to-image creation and single-image editing with simple prompt-driven controls.

Qwen Image 3.0
Văn bản sang hình ảnh

$0.024 /ảnh

qwen-image-3

Alibaba's third-generation image model for long prompts, information-dense layouts, fine text rendering, multilingual visuals, and knowledge-rich image generation.

FLUX 3 Image Klein
Văn bản sang hình ảnh

$0.009 /ảnh

flux-3-klein

Generate and edit images with FLUX 3 Image Klein. Use 1K, 2K or 4K output, up to ten editing references, custom dimensions, and PNG, JPEG or WebP output.

Seedream 5.0 Pro
Văn bản sang hình ảnh

$0.075 /ảnh

seedream-5.0-pro

ByteDance's flagship image model for precise prompt following, dense layouts, multilingual text rendering, and region-precise editing.

GPT Image 2.5
Văn bản sang hình ảnh

$4.00 Nhập 1M

gpt-image-2.5-flare

OpenAI image generation and editing with high-fidelity reference images, precise inpainting, multi-turn consistency, and transparent backgrounds. Explore Flare and Sunburst and compare GPT Image 2.5 with GPT Image 2 on PoYo.

GPT Image 2.6
Văn bản sang hình ảnh

$4.00 Nhập 1M

gpt-image-2.6-flare

Affordable GPT Image 2.6 API for text-to-image and reference image editing with OpenAI's Flare and Sunburst. One REST call, from 1.7 credits ($0.0085) per image on PoYo.

Grok Imagine Image 2.0
Văn bản sang hình ảnh

$0.04 /ảnh

grok-imagine-image-2.0

xAI image generation and editing with up to three input images, five supported aspect ratios, 1K or 2K resolution, selectable quality, and up to four outputs.

MAI Image 2.7
Văn bản sang hình ảnh

$1.75 Nhập 1M

mai-image-2.7

MAI Image 2.7 and MAI Image 2.7 Flash API on PoYo: Microsoft's image models for text-to-image and precise editing with up to 5 reference images, transparent backgrounds, and custom sizes up to 4,194,304 pixels.

MAI Image 2.6
Văn bản sang hình ảnh

$1.40 Nhập 1M

mai-image-2.6

MAI Image 2.6 and MAI Image 2.6 Flash API on PoYo: Microsoft's image models for photorealistic text-to-image, legible in-image text, and editing or composition with up to 5 reference images, with optional web search grounding.

MiniMax H3 Image
Văn bản sang hình ảnh

$0.016 /ảnh

minimax-h3-image

MiniMax H3 Image API on PoYo: MiniMax's open-weight image model for text-to-image and editing with up to 16 reference images, 1K, 2K or 4K output, custom sizes up to 20 megapixels, and sharp in-image text. From 3.2 credits ($0.016) per image.

Qwen Image 2.1
Văn bản sang hình ảnh

$0.03 /lần tạo

qwen-image-2.1

Alibaba's 7B open-weight unified text-to-image and editing model with native RGBA transparency, up to 10 reference images, and 2K resolution.

Seedream 5.5
Văn bản sang hình ảnh

$0.008 /ảnh

seedream-5.5

Seedream 5.5 API on PoYo: ByteDance Seed's image model for text-to-image, multi-reference editing with up to 10 images, native transparent PNGs, and layer decomposition into a base image plus up to 99 layers. From 4 credits ($0.02) per image.

Kling Image 4.0
Văn bản sang hình ảnh

$0.065 /ảnh

kling-4.0-image

Kling Image 4.0 API on PoYo: Kling AI's image model for native 8K text-to-image and editing with up to 10 references, including multi-angle elements, matching image sets of up to 10 images, and long webpage or ecommerce page designs. From 13 credits ($0.065) per image.

Ideogram 4.5
Văn bản sang hình ảnh

$0.008 /ảnh

ideogram-v4.5

Generate images, posters and typography with Ideogram 4.5, or precisely edit a source image with masks and reference images. Compare quality-based pricing for generation and editing on PoYo.

Ideogram 4.6
Văn bản sang hình ảnh

$0.008 /ảnh

ideogram-v4.6

Ideogram 4.6 API on PoYo: Ideogram's image model for text-to-image up to 4096 pixels per side and precise image editing with masks, up to 4 reference images and high-precision edits. Four quality levels, 2K and 4K price tiers, from 1.6 credits ($0.008) per image.

Ideogram Vector 1.0
Văn bản sang hình ảnh

$0.10 /ảnh

ideogram-vector-1.0/text-to-vector

Ideogram Vector creates editable SVG artwork from a text prompt, with optional reference images, or converts one image into an SVG. Text to vector is billed per SVG at the same rates Fal publishes for low, medium, and high quality.

Nano Banana 2.1
Văn bản sang hình ảnh

$0.02 /ảnh

nano-banana-2.1

Generate and edit 1K, 2K and 4K images with Google's Nano Banana 2.1. Combine up to 10 reference images for product visuals, posters and consistent creative assets. From 4 credits ($0.02) per image.

Recraft V4.1
Văn bản sang hình ảnh

$0.007 /ảnh

recraft-v4.1-flash

Recraft V4.1 API on PoYo: design-ready images and editable SVG vectors from text. Choose Flash, Standard or Pro for raster images, or Vector and Pro Vector for SVG, with five aspect ratios and optional palette and background colors. From 1.4 credits ($0.007) per image.

Seedream 5.0 Flash
Văn bản sang hình ảnh

$0.02 /ảnh

seedream-5.0-flash

ByteDance's fast, cost-efficient image model for 1K/1.5K/2K generation, multi-reference editing, and multilingual visual content. 4 credits per image.

FLUX.2
Văn bản sang hình ảnh

$0.03 /lần tạo

flux-2-pro

Black Forest Labs' production-grade model combining 4MP image generation and editing with multi-reference support, precise typography, and hex color control.

GPT Image 1.5
Văn bản sang hình ảnh

$0.01 /lần tạo

gpt-image-1.5

OpenAI's latest image model with 4x speed, precision editing, and superior text rendering.

Grok Imagine
Văn bản sang hình ảnh

$0.03 /ảnh

grok-imagine-image

xAI's Aurora-powered visual AI for image generation and video creation with Fun, Normal, and Spicy creative modes.

Nano Banana
Văn bản sang hình ảnh

$0.025 /lần tạo

nano-banana

Google's leaderboard-topping image model (Gemini 2.5 Flash) excelling in natural language editing, character consistency, and multi-image blending.

Seedream 4
Văn bản sang hình ảnh

$0.025 /lần tạo

seedream-4

ByteDance's multimodal image model for native 1K to 4K generation, reference-guided editing, and batch outputs up to 15 images.

Z-Image
Văn bản sang hình ảnh

$0.01 /lần tạo

z-image

Alibaba's efficient 6B-parameter image model with sub-second generation and exceptional Chinese-English bilingual text rendering capabilities.

Flux Kontext
Văn bản sang hình ảnh

$0.04 /lần tạo

flux-kontext-pro

Black Forest Labs' in-context image generation and editing family for scene-preserving edits, text replacement, and prompt-driven visual changes.

GPT-4o Image
Văn bản sang hình ảnh

$0.02 /lần tạo

gpt-4o-image

OpenAI's native multimodal image generator with exceptional text rendering, precise prompt following, and conversational editing capabilities.

Seedream 4.5
Văn bản sang hình ảnh

$0.025 /lần tạo

seedream-4.5

ByteDance's unified 4K image generation and editing model with professional-grade text rendering and commercial photography quality.

Nano Banana 2
Văn bản sang hình ảnh

$0.025 /lần tạo

nano-banana-2-new

Google's next-gen image model powered by Gemini 3.1 Flash with native 2K/4K resolution, chain-of-thought reasoning, precise multi-language text rendering, and up to 14 reference images.

Seedream 5.0 Lite
Văn bản sang hình ảnh

$0.025 /lần tạo

seedream-5.0-lite

ByteDance's efficient multimodal image model with native 2K/3K resolution, deep thinking, bilingual text rendering, and smart editing.

Wan 2.7 Image
Văn bản sang hình ảnh

$0.021 /lần tạo

wan-2.7-image

Alibaba's unified Wan 2.7 image family for text-to-image generation and reference-based image editing with standard and pro quality tiers.

Nano Banana 2 Lite
Văn bản sang hình ảnh

$0.025 /lần tạo

nano-banana-2-lite

Google's fastest and most cost-efficient Gemini Image model, built for rapid ideation, high-throughput image generation, low-latency creative workflows, and scaled production pipelines.

Kling O3 Image
Văn bản sang hình ảnh

$0.018 /ảnh

kling-o3-image

Kling's O3 image family supports prompt-only generation, multi-reference editing, single outputs, and connected series generation with 1K to 4K resolution tiers.

Flux Dev
Văn bản sang hình ảnh

$0.02 /megapixel

flux-dev

Black Forest Labs image model for text-to-image generation and single-image editing with output-size based pricing.

Flux Schnell
Văn bản sang hình ảnh

$0.002 /megapixel

flux-schnell

Black Forest Labs fast text-to-image model for low-cost prompt-based image generation with output-size based pricing.

Grok Imagine Image Quality
Văn bản sang hình ảnh

$0.04 /ảnh

grok-imagine-image-quality

xAI's higher-fidelity Grok Imagine image model for polished text-to-image generation and reference-based image editing.

Văn bản sang hình ảnh Model API - Giá cả và mô hình phù hợp

So sánh nhà cung cấp, đầu vào hỗ trợ, định dạng đầu ra và giá trước khi chọn mô hình.

Đúng phù hợp với nhiệm vụ

Các mô hình chỉ xuất hiện ở đây khi các metadata danh mục của họ bao gồm Text to Image.

So sánh nhà cung cấp

Xem xét các gia đình mô hình trên các nhà cung cấp mà không rời khỏi thư mục nhiệm vụ.

Các đường dẫn sẵn sàng cho API

Mỗi thẻ mô hình liên kết đến giá PoYo, ví dụ, điều khiển sân chơi và chi tiết API.

Mô hìnhNhà cung cấpCác loại nhiệm vụGiá
Nano Banana Pro

nano-banana-pro

GoogleText to Image, Image to Image$0.04/lần tạo
GPT Image 2

gpt-image-2

OpenAIText to Image, Image to Image$0.01/lần tạo
Qwen Image 3.0

qwen-image-3

AlibabaText to Image, Image to Image, Uncensored$0.024/ảnh
FLUX 3 Image Klein

flux-3-klein

Black Forest LabsText to Image, Image to Image$0.009/ảnh
Seedream 5.0 Pro

seedream-5.0-pro

SeedreamText to Image, Image to Image, Uncensored$0.075/ảnh
GPT Image 2.5

gpt-image-2.5-flare

OpenAIText to Image, Image to Image$4.00Nhập 1M
GPT Image 2.6

gpt-image-2.6-flare

OpenAIText to Image, Image to Image$4.00Nhập 1M
Grok Imagine Image 2.0

grok-imagine-image-2.0

xAIText to Image, Image to Image$0.04/ảnh
MAI Image 2.7

mai-image-2.7

MicrosoftText to Image, Image to Image$1.75Nhập 1M
MAI Image 2.6

mai-image-2.6

MicrosoftText to Image, Image to Image$1.40Nhập 1M
MiniMax H3 Image

minimax-h3-image

MiniMaxText to Image, Image to Image$0.016/ảnh
Qwen Image 2.1

qwen-image-2.1

AlibabaText to Image, Image to Image$0.03/lần tạo
Seedream 5.5

seedream-5.5

SeedreamText to Image, Image to Image$0.008/ảnh
Kling Image 4.0

kling-4.0-image

KlingText to Image, Image to Image$0.065/ảnh
Ideogram 4.5

ideogram-v4.5

IdeogramText to Image, Image to Image$0.008/ảnh
Ideogram 4.6

ideogram-v4.6

IdeogramText to Image, Image to Image$0.008/ảnh
Ideogram Vector 1.0

ideogram-vector-1.0/text-to-vector

IdeogramText to Image, Image to Image$0.10/ảnh
Nano Banana 2.1

nano-banana-2.1

GoogleText to Image, Image to Image$0.02/ảnh
Recraft V4.1

recraft-v4.1-flash

RecraftText to Image$0.007/ảnh
Seedream 5.0 Flash

seedream-5.0-flash

SeedreamText to Image, Image to Image$0.02/ảnh
FLUX.2

flux-2-pro

Black Forest LabsText to Image, Image to Image$0.03/lần tạo
GPT Image 1.5

gpt-image-1.5

OpenAIText to Image, Image to Image$0.01/lần tạo
Grok Imagine

grok-imagine-image

xAIText to Image, Image to Video, Uncensored$0.03/ảnh
Nano Banana

nano-banana

GoogleText to Image, Image to Image$0.025/lần tạo
Seedream 4

seedream-4

SeedreamText to Image, Image to Image$0.025/lần tạo
Z-Image

z-image

AlibabaText to Image, Uncensored$0.01/lần tạo
Flux Kontext

flux-kontext-pro

Black Forest LabsText to Image, Image to Image$0.04/lần tạo
GPT-4o Image

gpt-4o-image

OpenAIText to Image, Image to Image$0.02/lần tạo
Seedream 4.5

seedream-4.5

SeedreamText to Image, Image to Image, Uncensored$0.025/lần tạo
Nano Banana 2

nano-banana-2-new

GoogleText to Image, Image to Image$0.025/lần tạo
Seedream 5.0 Lite

seedream-5.0-lite

SeedreamText to Image, Image to Image, Uncensored$0.025/lần tạo
Wan 2.7 Image

wan-2.7-image

AlibabaText to Image, Image to Image$0.021/lần tạo
Nano Banana 2 Lite

nano-banana-2-lite

GoogleText to Image, Image to Image$0.025/lần tạo
Kling O3 Image

kling-o3-image

KlingText to Image, Image to Image$0.018/ảnh
Flux Dev

flux-dev

Black Forest LabsText to Image, Image to Image$0.02/megapixel
Flux Schnell

flux-schnell

Black Forest LabsText to Image$0.002/megapixel
Grok Imagine Image Quality

grok-imagine-image-quality

xAIText to Image, Image to Image$0.04/ảnh

Những câu hỏi thường được hỏi

API tạo ảnh từ văn bản là gì?

+

API chuyển văn bản thành hình ảnh tạo ra hình ảnh mới từ hướng dẫn văn bản. Ứng dụng của bạn sẽ gửi lời nhắc và cài đặt được hỗ trợ tới một mô hình, sau đó truy xuất kết quả. Nó rất hữu ích cho các sản phẩm sáng tạo, sản xuất chiến dịch và tạo nội dung tự động khi không có hình ảnh hiện có để chỉnh sửa.

Làm cách nào để viết lời nhắc cho API tạo hình ảnh AI?

+

Bắt đầu với chủ thể chính, sau đó mô tả hành động hoặc diện mạo, bố cục, hậu cảnh, ánh sáng và phong cách của chủ thể đó. Tách biệt các yêu cầu quan trọng khỏi các chi tiết trang trí. Đối với ý tưởng sản phẩm, hãy chỉ định chất liệu và góc camera; đối với một áp phích, hãy chỉ định bố cục dự định và trích dẫn chính xác văn bản mà bạn muốn.

Tôi nên chọn mô hình chuyển văn bản thành hình ảnh nào?

+

Kiểm tra một số model có cùng lời nhắc đại diện và cài đặt đầu ra. Ghi điểm các chi tiết quan trọng đối với trường hợp sử dụng của bạn: hình dạng sản phẩm, khuôn mặt, chữ viết, bố cục hoặc phong cách minh họa. So sánh kết quả có thể sử dụng và chi phí thử lại thay vì chỉ chọn theo mức giá khởi điểm được niêm yết thấp nhất.

API chuyển văn bản thành hình ảnh có thể tạo văn bản có thể đọc được trong ảnh không?

+

Một số mẫu hình ảnh xử lý chữ tốt hơn các mẫu khác, nhưng văn bản được tạo vẫn cần kiểm tra. Giữ bản sao được yêu cầu ngắn gọn và được trích dẫn rõ ràng. Để có bản sao pháp lý, giá cả hoặc kiểu chữ thương hiệu chính xác, trước tiên hãy tạo hình ảnh trực quan và thêm văn bản cuối cùng vào quy trình thiết kế hoặc kết xuất của bạn.

Làm cách nào để giữ được phong cách hình ảnh hoặc nhân vật nhất quán?

+

Sử dụng lại mô tả phong cách rõ ràng và kiểm tra cấu trúc lời nhắc tương tự trên loạt hình ảnh của bạn. Nếu danh tính của một người hoặc sản phẩm phải giống với thiết kế hiện có, hãy sử dụng mô hình có đầu vào hình ảnh tham chiếu được hỗ trợ thông qua Image to Image. Chỉ một lời nhắc văn bản lặp đi lặp lại không đảm bảo kết quả đầu ra giống hệt nhau.

Có những độ phân giải và tỷ lệ khung hình nào?

+

Các kích thước và tỷ lệ khung hình được hỗ trợ dành riêng cho mô hình và điểm cuối đã chọn. Chọn cài đặt phù hợp với vị trí cuối cùng, chẳng hạn như bài đăng trên mạng xã hội dọc hoặc ảnh bìa ngang. Kiểm tra trang mô hình trước khi gửi yêu cầu; kích thước được nâng cấp và độ phân giải thế hệ gốc là các phép đo khác nhau.

Tôi có thể tạo nhiều hình ảnh hoặc tự động hóa một loạt hình ảnh không?

+

Bạn có thể điều phối nhiều yêu cầu API trong ứng dụng của mình. Kiểm tra xem mô hình đã chọn có cung cấp tham số đếm đầu ra hay không vì một yêu cầu không phải lúc nào cũng có một hình ảnh. Giới hạn công việc đồng thời ở mức cho phép tài khoản của bạn, lưu từng ID nhiệm vụ được trả về và theo dõi chi phí của toàn bộ lô.

Sự khác biệt giữa văn bản với hình ảnh và hình ảnh với API hình ảnh là gì?

+

Text to Image tạo hình ảnh mới từ hướng dẫn bằng văn bản. Image to Image bắt đầu bằng một hình ảnh hiện có và sử dụng nó để hướng dẫn chỉnh sửa, biến thể hoặc bố cục mới. Chọn cái sau khi một sản phẩm, con người hoặc bố cục cụ thể sẽ cung cấp điểm bắt đầu trực quan.

Làm cách nào để nhận được hình ảnh được tạo?

+

Đối với các điểm cuối tạo PoYo, hãy gửi mô hình và đầu vào của nó tới /api/generate/submit. Lưu task_id được trả về, sau đó truy vấn /api/generate/status/{task_id} hoặc cung cấp callback_url được hỗ trợ. Đọc kết quả từ phản hồi tác vụ đã hoàn thành và lưu trữ mọi nội dung mà ứng dụng của bạn cần giữ lại.

Giá API chuyển văn bản thành hình ảnh được tính như thế nào?

+

So sánh giá model và đơn vị thanh toán của nó. Tùy thuộc vào điểm cuối, việc tạo hình ảnh có thể được định giá theo hình ảnh, theo thế hệ hoặc theo kích thước hình ảnh, kèm theo phí bổ sung cho các tùy chọn cụ thể. Sử dụng giá mô hình hiện tại và cài đặt đã chọn để ước tính một lô thay vì giả sử tất cả API hình ảnh đều có cùng chi phí.

Tôi nên làm gì nếu yêu cầu hình ảnh không thành công hoặc hết thời gian chờ?

+

Kiểm tra trạng thái tác vụ trước khi gửi lại: thời gian chờ mạng không chứng tỏ rằng việc tạo không thành công. Kiểm tra xác thực đầu vào, cài đặt hình ảnh, số dư tài khoản và lỗi trả về. Đối với những hình ảnh đã hoàn thiện nhưng không phù hợp, hãy đơn giản hóa lời nhắc hoặc thay đổi từng cài đặt một để bạn có thể xác định điều gì cải thiện kết quả.

Tôi có thể tìm thấy các ví dụ về Python, JavaScript và yêu cầu ở đâu?

+

Mở trang mô hình để xem tài liệu API, các trường yêu cầu hiện tại và ví dụ. Mỗi mô hình cũng có tài nguyên /models/{model-id}/llms.txt với các chi tiết tích hợp dành riêng cho từng mô hình. Giữ khóa API của bạn trong cấu hình phía máy chủ và sử dụng mã định danh mô hình được ghi lại khi điều chỉnh ví dụ cho ứng dụng của bạn.