이 페이지는 Legacy API 문서입니다. 현재 API Gateway의 새 문서로 통합·이전될 예정이며, 신규 통합에는 API Gateway 사용을 권장합니다.
구글 이미지 생성
텍스트 프롬프트만 입력하면, 구글 Generative AI SDK의
generate_images 메서드가
자동으로 이미지를 생성해줍니다. 원하는 이미지 개수, 설명 이유(RAI), 이미지 포맷 등
다양한 옵션도 손쉽게 설정할 수 있어, 빠르고 유연한 이미지 생성이 가능합니다.- SDK: 구글 AI SDK
| API | 지원 모델 |
|---|---|
| google/models/generate-images | imagen-3.0-generate-002 |
이미지 생성
POST
/v1/api/google/models/generate-images요청 헤더
파라미터
model
string
required
이미지 생성에 사용되는 모델의 이름입니다.
현재 지원 모델은
imagen-3.0-generate-002입니다.prompt
string
required
생성하고자 하는 이미지의 텍스트 설명입니다.
config
object
이미지 생성에 대한 설정을 포함하는 선택적 구성 객체입니다.
number_of_images
응답에서 생성할 이미지의 개수입니다. 범위: 1-4 (기본값: 4)integer
negative_prompt
생성하지 않을 요소를 지정합니다. 모델이 특정 객체나 스타일을 피하도록 안내합니다.string
safety_filter_level
콘텐츠 필터링 수준을 제어합니다. 옵션:string
BLOCK_LOW_AND_ABOVE: 낮은 위험 이상의 콘텐츠 차단BLOCK_MEDIUM_AND_ABOVE: 중간 위험 이상의 콘텐츠 차단 (기본값)BLOCK_ONLY_HIGH: 높은 위험 콘텐츠만 차단
include_rai_reason
응답에 RAI(Responsible AI) 사유를 포함할지 여부입니다. 콘텐츠가 차단되거나
조정된 경우, 그 이유에 대한 간단한 설명을 포함하여 투명성을 높입니다. 기본값:
boolean
false 사용 예시: 사용자에게 왜 이미지 생성이 제한되었는지를 설명하고자 할 때
유용합니다.output_mime_type
반환될 이미지의 string
MIME 형식입니다. 이 설정은 이미지가 어떤 형식(image/png,
image/jpeg, image/webp)으로 인코딩되어 반환될지를 제어합니다. 기본값은
모델마다 다를 수 있으며, 일반적으로 image/png 또는 image/jpeg 중 하나입니다.
배경이 투명한 이미지를 원한다면 image/png 또는 image/webp를 선택하세요.마지막 수정 날짜: May 07, 2025
요청 예시
curl https://factchat-cloud.mindlogic.ai/v1/api/google/models/generate-images\
-H "Content-Type: application/json" \
-H "Authorization: Bearer $YOUR_API_KEY" \
-d '{
"model": "imagen-3.0-generate-002",
"prompt": "An umbrella in the foreground, and a rainy night sky in the background",
"config": {
"number_of_images": 1,
"include_rai_reason": true,
"output_mime_type": "image/jpeg"
}
}'응답 예시
{
"generatedImages": [
{
"image": {
"gcsUri": null,
"imageBytes": "/9j/4SkRgBA..." //base64,
"mimeType": "image/jpeg"
},
"raiFilteredReason": null,
"safetyAttributes": {
"categories": null,
"scores": null,
"contentType": null
},
"enhancedPrompt": "A detailed close-up of a black umbrella in the foreground, its dark fabric glistening with raindrops under the soft, ambient light of a rainy night. The background features a deep, inky blue night sky, with a soft glow from distant streetlights, creating a melancholic mood. A subtle mist hangs in the air, adding to the overall atmosphere of quiet solitude. The camera angle is slightly low, giving a sense of immersion into the scene. The rainy night sky is rich with deep blues and blacks, with subtle gradations of color that suggest the gentle fall of rain. The umbrella's handle, made of dark wood, is slightly out of focus, emphasizing the focus on the texture and detail of the umbrella's surface. The image captures the tranquility of a rainy night in a city."
}
],
"positivePromptSafetyAttributes": null
}