이미지 생성 스킬
개요
이 스킬은 구조화된 프롬프트와 Python 스크립트를 사용하여 고품질 이미지를 생성합니다. 워크플로는 JSON 형식의 프롬프트 생성과 선택적 참조 이미지를 사용한 이미지 생성 실행을 포함합니다.
핵심 기능
- AIGC 이미지 생성을 위한 구조화된 JSON 프롬프트 생성
- 스타일/구성 안내를 위한 여러 참조 이미지 지원
- 자동화된 Python 스크립트 실행을 통한 이미지 생성
- 다양한 이미지 생성 시나리오 처리 (캐릭터 디자인, 장면, 제품 등)
워크플로
1단계: 요구 사항 파악
사용자가 이미지 생성을 요청하면 다음을 식별하세요:
- 주제/내용: 이미지에 무엇이 있어야 하는지
- 스타일 선호도: 아트 스타일, 분위기, 색상 팔레트
- 기술 사양: 종횡비, 구도, 조명
- 참조 이미지: 생성을 안내할 이미지
/mnt/user-data아래 폴더를 확인할 필요는 없습니다.
2단계: 구조화된 프롬프트 생성
/mnt/user-data/workspace/ 경로에 {descriptive-name}.json 패턴으로 구조화된 JSON 파일을 생성하세요.
3단계: 생성 실행
Python 스크립트를 호출하세요:
python /mnt/skills/public/image-generation/scripts/generate.py \
--prompt-file /mnt/user-data/workspace/prompt-file.json \
--reference-images /path/to/ref1.jpg /path/to/ref2.png \
--output-file /mnt/user-data/outputs/generated-image.jpg \
--aspect-ratio 16:9
매개변수:
--prompt-file: JSON 프롬프트 파일의 절대 경로 (필수)--reference-images: 참조 이미지의 절대 경로 (선택 사항, 공백으로 구분)--output-file: 출력 이미지 파일의 절대 경로 (필수)--aspect-ratio: 생성된 이미지의 종횡비 (선택 사항, 기본값: 16:9)
[!NOTE] Python 파일을 읽지 말고 매개변수와 함께 호출하세요.
캐릭터 생성 예시
사용자 요청: "1990년대 도쿄 거리 스타일 여성 캐릭터 생성"
프롬프트 파일 생성: /mnt/user-data/workspace/asian-woman.json
{
"characters": [{
"gender": "female",
"age": "mid-20s",
"ethnicity": "Japanese",
"body_type": "slender, elegant",
"facial_features": "delicate features, expressive eyes, subtle makeup with emphasis on lips, long dark hair partially wet from rain",
"clothing": "stylish trench coat, designer handbag, high heels, contemporary Tokyo street fashion",
"accessories": "minimal jewelry, statement earrings, leather handbag",
"era": "1990s"
}],
"negative_prompt": "blurry face, deformed, low quality, overly sharp digital look, oversaturated colors, artificial lighting, studio setting, posed, selfie angle",
"style": "Leica M11 street photography aesthetic, film-like rendering, natural color palette with slight warmth, bokeh background blur, analog photography feel",
"composition": "medium shot, rule of thirds, subject slightly off-center, environmental context of Tokyo street visible, shallow depth of field isolating subject",
"lighting": "neon lights from signs and storefronts, wet pavement reflections, soft ambient city glow, natural street lighting, rim lighting from background neons",
"color_palette": "muted naturalistic tones, warm skin tones, cool blue and magenta neon accents, desaturated compared to digital photography, film grain texture"
}
생성 실행:
python /mnt/skills/public/image-generation/scripts/generate.py \
--prompt-file /mnt/user-data/workspace/cyberpunk-hacker.json \
--output-file /mnt/user-data/outputs/cyberpunk-hacker-01.jpg \
--aspect-ratio 2:3
참조 이미지 포함:
{
"characters": [{
"gender": "based on [Image 1]",
"age": "based on [Image 1]",
"ethnicity": "human from [Image 1] adapted to Star Wars universe",
"body_type": "based on [Image 1]",
"facial_features": "matching [Image 1] with slight weathered look from space travel",
"clothing": "Star Wars style outfit - worn leather jacket with utility vest, cargo pants with tactical pouches, scuffed boots, belt with holster",
"accessories": "blaster pistol on hip, comlink device on wrist, goggles pushed up on forehead, satchel with supplies, personal vehicle based on [Image 2]",
"era": "Star Wars universe, post-Empire era"
}],
"prompt": "Character inspired by [Image 1] standing next to a vehicle inspired by [Image 2] on a bustling alien planet street in Star Wars universe aesthetic. Character wearing worn leather jacket with utility vest, cargo pants with tactical pouches, scuffed boots, belt with blaster holster. The vehicle adapted to Star Wars aesthetic with weathered metal panels, repulsor engines, desert dust covering, parked on the street. Exotic alien marketplace street with multi-level architecture, weathered metal structures, hanging market stalls with colorful awnings, alien species walking by as background characters. Twin suns casting warm golden light, atmospheric dust particles in air, moisture vaporators visible in distance. Gritty lived-in Star Wars aesthetic, practical effects look, film grain texture, cinematic composition.",
"negative_prompt": "clean futuristic look, sterile environment, overly CGI appearance, fantasy medieval elements, Earth architecture, modern city",
"style": "Star Wars original trilogy aesthetic, lived-in universe, practical effects inspired, cinematic film look, slightly desaturated with warm tones",
"composition": "medium wide shot, character in foreground with alien street extending into background, environmental storytelling, rule of thirds",
"lighting": "warm golden hour lighting from twin suns, rim lighting on character, atmospheric haze, practical light sources from market stalls",
"color_palette": "warm sandy tones, ochre and sienna, dusty blues, weathered metals, muted earth colors with pops of alien market colors",
"technical": {
"aspect_ratio": "9:16",
"quality": "high",
"detail_level": "highly detailed with film-like texture"
}
}
python /mnt/skills/public/image-generation/scripts/generate.py \
--prompt-file /mnt/user-data/workspace/star-wars-scene.json \
--reference-images /mnt/user-data/uploads/character-ref.jpg /mnt/user-data/uploads/vehicle-ref.jpg \
--output-file /mnt/user-data/outputs/star-wars-scene-01.jpg \
--aspect-ratio 16:9
일반적인 시나리오
시나리오에 따라 다른 JSON 스키마를 사용하세요.
캐릭터 디자인:
- 신체적 속성 (성별, 나이, 민족, 체형)
- 얼굴 특징 및 표정
- 의복 및 액세서리
- 역사적 시대 또는 배경
- 포즈 및 맥락
장면 생성:
- 환경 설명
- 시간대, 날씨
- 분위기와 느낌
- 초점 및 구성
제품 시각화:
- 제품 세부 정보 및 재료
- 조명 설정
- 배경 및 맥락
- 프레젠테이션 각도
특정 템플릿
사용자 요청과 일치하는 경우에만 다음 템플릿 파일을 읽으세요.
출력 처리
생성 후:
- 이미지는 일반적으로
/mnt/user-data/outputs/에 저장됩니다. present_files도구를 사용하여 생성된 이미지를 사용자와 공유하세요.- 생성 결과에 대한 간략한 설명을 제공하세요.
- 필요시 조정을 위해 반복 작업을 제안하세요.
팁: 참조 이미지로 생성 품질 향상
시각적 정확성이 중요한 시나리오의 경우, 생성 전에 먼저 image_search 도구를 사용하여 참조 이미지를 찾으세요.
image_search 도구 사용이 권장되는 시나리오:
- 캐릭터/초상화 생성: 얼굴 특징과 신체 비율을 안내하기 위해 유사한 포즈, 표정 또는 스타일 검색
- 특정 객체 또는 제품: 정확한 표현을 보장하기 위해 실제 객체의 참조 이미지 검색
- 건축 또는 환경 장면: 진정한 디테일을 포착하기 위해 위치 참조 이미지 검색
- 패션 및 의류: 정확한 의상 디테일과 스타일링을 보장하기 위해 스타일 참조 이미지 검색
예시 워크플로:
image_search도구를 호출하여 적합한 참조 이미지를 찾습니다:image_search(query="Japanese woman street photography 1990s", size="Large")- 반환된 이미지 URL을 로컬 파일로 다운로드합니다.
- 다운로드한 이미지를 생성 스크립트의
--reference-images매개변수로 사용합니다.
이 접근 방식은 텍스트 설명에만 의존하는 대신 구체적인 시각적 안내를 모델에 제공하여 생성 품질을 크게 향상시킵니다.
제공자 (Gemini / MiniMax)
이 스킬은 환경 변수를 통해 제공자를 자동 선택합니다 (CLI 변경 없음):
GEMINI_API_KEY설정 → Gemini 사용 (기본값, 변경 없음).MINIMAX_API_KEY만 설정 → MiniMax 사용 (/v1/image_generation, 모델image-01).IMAGE_GENERATION_PROVIDER=gemini|minimax로 명시적으로 강제 설정.
MiniMax 선택적 재정의: MINIMAX_API_HOST (기본값 https://api.minimaxi.com),
MINIMAX_IMAGE_MODEL (기본값 image-01). 참조 이미지는 MiniMax의
subject_reference 캐릭터 이미지로 전송됩니다. CLI와 --prompt-file / --reference-images
/ --output-file / --aspect-ratio 인수는 두 제공자 모두 동일합니다.
MiniMax 프롬프트 처리 (제공자 내부). 작성은 제공자에 관계없이 동일합니다. — 활성화된 제공자와 관계없이 동일한 구조화된 JSON을 작성하세요. MiniMax image-01은 단일 텍스트 문자열을 사용하므로, MiniMax 경로 자체는 JSON prompt 필드만 전송하고 (다른 필드 (예: style / composition / negative_prompt)는 Gemini 경로에 적용됨) prompt_optimizer를 활성화하여 MiniMax가 서버 측에서 확장하도록 합니다. MiniMax는 해당 프롬프트를 1500자로 제한합니다. prompt 필드가 더 길면 스크립트는 API를 호출하는 대신 오류를 반환합니다. Gemini 경로는 전체 구조화된 JSON을 받습니다.
참고 사항
- 사용자 언어와 관계없이 프롬프트는 항상 영어를 사용하세요.
- JSON 형식은 구조화되고 구문 분석 가능한 프롬프트를 보장합니다.
- 참조 이미지는 생성 품질을 크게 향상시킵니다.
- 최적의 결과를 위해 반복적인 개선이 일반적입니다.
- 캐릭터 생성의 경우, 상세한 캐릭터 객체와 통합된 프롬프트 필드를 포함하세요.