Flux 초고해상도
극강의 디테일과 해상도를 갖춘 최고 품질의 이미지 생성 서비스입니다.
✓ 4K 해상도
✓ 극강의 디테일
✓ RAW 품질
✓ 전문가급 결과물
인증
Doitong API를 통해 Flux Ultra에 액세스하려면 Doitong API 키를 사용하세요. GraphQL mutation 또는 REST API 헤더에 해당 키를 포함해야 합니다.
// GraphQL Header
{
"Authorization": "Bearer YOUR_API_KEY"
}
// REST Header
"X-API-Key": "YOUR_API_KEY"
빠른 시작
단 몇 분 만에 Flux Ultra API을(를) 시작해 보세요. 다음의 간단한 단계를 따라 첫 번째 text to image을(를) 생성할 수 있습니다.
1단계: API 키 발급받기
Doitong 계정에 가입하고 대시보드에서 API 키를 생성하세요.
2단계: 첫 번째 요청 보내기
아래 코드 예시 중 하나를 사용하여 첫 번째 API 호출을 시도해 보세요.
curl -X POST https://api.doitong.com/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"query": "mutation Generate($input: GenerateInput!) { generate(input: $input) { id status type provider url metadata creditCost } }",
"variables": {
"input": {
"type": "IMAGE",
"provider": "flux-ultra",
"input": {
"text": "A futuristic city with flying cars and neon lights"
},
"options": {
"width": 1024,
"height": 1024
}
}
}
}'
const response = await fetch('https://api.doitong.com/graphql', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
},
body: JSON.stringify({
query: `
mutation GenerateImage($input: ImageGenerationInput!) {
generateImage(input: $input) {
id
url
width
height
}
}
`,
variables: {
input: {
service: 'flux-ultra',
prompt: 'A futuristic city with flying cars and neon lights',
width: 1024,
height: 1024
}
}
})
});
const data = await response.json();
console.log('Image:', data.data.generateImage);
import requests
import json
url = "https://api.doitong.com/graphql"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY"
}
query = """
mutation Generate($input: GenerateInput!) {
generate(input: $input) {
id
status
type
provider
url
metadata
creditCost
}
}
"""
variables = {
"input": {
"type": "IMAGE",
"provider": "flux-ultra",
"input": {
"text": "A futuristic city with flying cars and neon lights"
},
"options": {
"width": 1024,
"height": 1024
}
}
}
response = requests.post(url, json={
"query": query,
"variables": variables
}, headers=headers)
data = response.json()
print("Result:", data["data"]["generate"])
mutation Generate($input: GenerateInput!) {
generate(input: $input) {
id
status
type
provider
url
metadata
creditCost
createdAt
}
}
# Variables
{
"input": {
"type": "IMAGE",
"provider": "flux-ultra",
"input": {
"text": "A futuristic city with flying cars and neon lights"
},
"options": {
"width": 1024,
"height": 1024,
"version": "flux-pro-1.1-ultra",
"quality": "high"
}
}
}
요금제
Flux Ultra API은(는) 크레딧 기반 요금 모델을 사용합니다. 생성된 콘텐츠의 복잡도와 길이에 따라 크레딧이 차감됩니다.
| 기능 | 크레딧 | 설명 |
|---|---|---|
| 표준 해상도 | 10-20 크레딧 | 512x512 ~ 1024x1024 픽셀 |
| 고해상도 | 30-50 크레딧 | 2048x2048 픽셀 이상 |
API 엔드포인트
Flux Ultra API은(는) 통합 GraphQL 엔드포인트를 통해 사용할 수 있습니다.
GraphQL 엔드포인트
POST https://api.doitong.com/graphql
REST 엔드포인트
POST https://api.doitong.com/v1/text_to_image
파라미터
Flux Ultra API 요청에 사용 가능한 파라미터:
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
service |
문자열(String) | Yes | 서비스 식별자: "flux-ultra" |
prompt |
문자열(String) | Yes | 생성할 내용에 대한 텍스트 설명 |
width |
정수(Integer) | No | 이미지 너비(픽셀) (기본값: 1024) |
height |
정수(Integer) | No | 이미지 높이(픽셀) (기본값: 1024) |
version |
문자열(String) | No | Model version: "flux-pro-1.1-ultra" |
webhookUrl |
문자열(String) | No | 완료 알림을 받을 URL |
응답 형식
모든 API 응답은 일관된 형식을 따릅니다:
성공 응답
{
"data": {
"generateimage": {
"id": "abc123xyz",
"status": "processing",
"url": null,
"webhookUrl": "https://your-webhook.com/callback",
"createdAt": "2024-01-01T00:00:00Z"
}
}
}
완료 응답
{
"data": {
"generateimage": {
"id": "abc123xyz",
"status": "completed",
"url": "https://cdn.doitong.com/outputs/abc123xyz.jpg",
"duration": null,
"createdAt": "2024-01-01T00:00:00Z"
}
}
}
오류 처리
API는 표준 HTTP 상태 코드를 사용하며 상세한 오류 메시지를 반환합니다.
공통 오류 코드
| 상태 코드 | 오류 유형 | 설명 |
|---|---|---|
| 400 | Bad Request | Invalid parameters or malformed request |
| 401 | Unauthorized | Missing or invalid API key |
| 402 | Payment Required | Insufficient credits |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Server error, please retry |
오류 응답 형식
{
"errors": [
{
"message": "Insufficient credits for this operation",
"extensions": {
"code": "INSUFFICIENT_CREDITS",
"creditsRequired": 100,
"creditsAvailable": 50
}
}
]
}
웹후크
text to image 생성이 완료되면 실시간 알림을 받을 수 있습니다.
웹후크 설정하기
Include a <code>webhookUrl</code> parameter in your request to receive a POST notification when processing is complete.
웹후크 페이로드
{
"id": "abc123xyz",
"status": "completed",
"url": "https://cdn.doitong.com/outputs/abc123xyz.jpg",
"service": "flux-ultra",
"createdAt": "2024-01-01T00:00:00Z",
"completedAt": "2024-01-01T00:01:00Z",
"metadata": {
"duration": null,
"width": 1920,
"height": 1080
}
}
웹후크 보안
모든 웹후크 요청에는 검증을 위한 서명 헤더가 포함됩니다:
X-Doitong-Signature: sha256=abc123...
요청 제한
공정한 사용과 시스템 안정성을 위해 다음과 같은 요청 제한이 적용됩니다:
| 플랜 | 분당 요청 수 | 동시 작업 수 | 일일 제한 |
|---|---|---|---|
| 무료 | 10 | 1 | 100 |
| 스타터 | 30 | 3 | 1,000 |
| 프로 | 60 | 10 | 10,000 |
| 엔터프라이즈 | 맞춤형 | 맞춤형 | 무제한 |
X-RateLimit-Limit: Maximum requests per windowX-RateLimit-Remaining: Requests remainingX-RateLimit-Reset: Window reset timestamp
권장 사항
1. 프롬프트 최적화
최상의 결과를 위해 명확하고 상세한 프롬프트를 작성하세요:
- Be specific about visual elements, style, and mood
- Include details about lighting, camera angles, and composition
- Avoid contradictory or impossible requests
2. 비동기 처리 관리
생성 작업은 비동기로 이루어집니다. 적절한 폴링이나 웹후크를 구현하세요:
// Polling example
async function pollStatus(jobId) {
let status = 'processing';
while (status === 'processing') {
await sleep(2000); // Wait 2 seconds
const result = await checkJobStatus(jobId);
status = result.status;
}
return result;
}
3. 오류 복구
지수 백오프(exponential backoff)를 포함한 재시도 로직을 구현하세요:
async function retryWithBackoff(fn, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
try {
return await fn();
} catch (error) {
if (i === maxRetries - 1) throw error;
await sleep(Math.pow(2, i) * 1000);
}
}
}
4. 크레딧 사용량 모니터링
서비스 중단을 방지하기 위해 크레딧 소모량을 추적하세요:
- Check credit balance before large batch operations
- Set up alerts for low credit thresholds
- Implement credit-aware request queuing
지금 시작해 보세요
수천 명의 개발자가 Flux Ultra API을(를) 사용하여 놀라운 콘텐츠를 만들고 있습니다