[G1-Sync] Manual knowledge update

This commit is contained in:
Antigravity Agent
2026-05-10 22:08:15 +09:00
parent 21ac3ed255
commit 504fd5fb42
3011 changed files with 380280 additions and 206977 deletions
@@ -1,72 +1,472 @@
---
id: wiki-2026-0508-ai-모델-사후-편집-도구-post-editing-tool
title: AI 모델 사후 편집 도구 (Post editing Tools)
title: AI Post-editing Tools (사후 편집)
category: 10_Wiki/Topics
status: needs_review
status: verified
canonical_id: self
aliases: []
aliases: [AI 모델 사후 편집, post-editing, inpainting, outpainting, vary region, upscale, remix]
duplicate_of: none
source_trust_level: A
confidence_score: 0.92
tags: [uncategorized]
source_trust_level: B
confidence_score: 0.85
verification_status: conceptual
tags: [image-generation, post-editing, inpainting, outpainting, upscale, midjourney, stable-diffusion, comfyui]
raw_sources: []
last_reinforced: 2026-05-08
last_reinforced: 2026-05-09
github_commit: pending
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
inferred_by: Claude Opus 4.7 (manual cleanup 2026-05-09)
tech_stack:
language: Python / API
framework: Diffusers / ComfyUI / Automatic1111 / Photoshop AI
---
# [[AI 모델 사후 편집 도구 (Post-editing Tools)|AI 모델 사후 편집 도구 (Post-editing Tools)]]
# AI Post-editing Tools (사후 편집)
## 📌 한 줄 통찰 (The Karpathy Summary)
AI 모델 사후 편집 도구는 인공지능을 통해 처음 생성된 이미지의 전체적인 맥락과 화풍을 유지하면서 특정 영역을 수정, 정교화 또는 확장할 수 있게 해주는 기능들입니다 [1, 2]. 대표적으로 인페인팅(Vary Region), 아웃페인팅(Zoom Out, Pan), 리믹스(Remix), 업스케일링(Upscale) 등이 포함됩니다 [3-5]. 이러한 도구들은 단발성 프롬프트 입력의 한계를 극복하고, 첫 결과물을 베이스 이미지로 삼아 점진적으로 창작자의 시각적 의도에 맞게 다듬어가는 프롬프트 엔지니어링의 핵심 과정으로 활용됩니다 [2, 5].
> **매 첫 generation 의 limit → iterative refinement**. **Inpainting (specific region), Outpainting (extend canvas), Remix (variation), Upscale (resolution + detail)**. 매 image 의 raw → polished. 매 base + post-editing > single perfect prompt.
## 📖 구조화된 지식 (Synthesized Content)
* **인페인팅 및 영역별 변주 (Inpainting / Vary Region)**
생성된 이미지의 특정 부분을 선택하여 해당 영역만 새로운 텍스트 프롬프트를 적용해 재생성하는 기능입니다 [1, 6, 7]. 미드저니(Midjourney)의 'Vary (Region)' 기능이나 스테이블 디퓨전(Stable Diffusion), DALL-E의 인페인팅 기능이 이에 해당합니다 [1, 5, 8]. 기존 이미지의 나머지 부분은 손상시키지 않고 작은 오류를 수정하거나 새로운 요소(예: 모자를 왕관으로 변경, 새를 추가 등)를 합성할 때 매우 유용합니다 [1, 2, 9].
* **아웃페인팅 및 시야 확장 (Outpainting / Zoom Out & Pan)**
초기 이미지가 너무 근접하게 촬영되었거나 구도 확장이 필요할 때 캔버스 밖의 영역을 논리적으로 생성해 내는 도구입니다 [2, 10, 11]. 'Zoom Out(줌 아웃)'은 원본 이미지의 네 면 밖으로 문맥과 요소를 추가하여 시야를 넓히며, 'Pan(팬)'은 특정 방향으로 캔버스를 확장합니다 [4, 9]. 이 과정에서 AI는 기존 화풍과 조명을 유지하면서 새로운 서사적 요소나 배경을 자연스럽게 배치합니다 [2, 9].
* **리믹스 모드 (Remix Mode)**
이미지의 변형(Variation)을 만들 때 기존 프롬프트 텍스트나 매개변수(Parameter)를 수정할 수 있게 해주는 강력한 기능입니다 [4, 12]. 특히 'Vary Region' 기능과 결합하면 선택된 영역을 어떻게 재생성할지 새로운 프롬프트로 정밀하게 지시할 수 있어 부분 편집의 통제력을 극대화합니다 [2, 13].
* **업스케일링 (Upscaling)**
초기 생성된 이미지의 해상도 치수를 확대하는 기능입니다 [5, 14]. 모델에 따라 단순히 크기만 키우는 것(Subtle Upscale)뿐만 아니라, 미세한 디테일과 질감을 추가하여 최종 결과물을 전문가 수준으로 다듬는 'Creative Upscale'과 같은 세부 조정 기능을 제공합니다 [9, 14].
* **기술적 노하우 및 반복적 정교화 전략 (Iterative Refinement)**
프롬프트 작성은 한 번에 끝나는 것이 아니라 AI와의 반복적인 협업 과정입니다 [2, 15, 16]. 첫 이미지를 베이스로 삼고 사후 편집 도구들을 활용해 점진적으로 수정해 나가는 것이 중요합니다 [2, 5]. 영역을 선택해 편집할 때는 수정하려는 대상뿐만 아니라 주변의 여백을 충분히 포함하여 선택해야 AI가 주변과의 연결성 및 맥락을 파악하여 자연스러운 합성을 수행할 수 있습니다 [2, 17].
### 매 5 core tool
#### 1. Inpainting (Vary Region)
- 매 specific region 의 mask + new prompt → regenerate.
- 매 surrounding 의 preserve.
- 매 small fix (extra finger, watermark, background change).
**매 platform**:
- **Midjourney**: Vary (Region).
- **Stable Diffusion**: native inpainting model.
- **DALL-E**: native edit.
- **Photoshop Generative Fill** (Adobe Firefly).
#### 2. Outpainting (Zoom Out / Pan)
- 매 canvas 의 extend.
- 매 surrounding 의 generate.
- 매 logical scene continuation.
**매 mode**:
- **Zoom Out**: 매 4 side 의 expand (1.5x, 2x).
- **Pan**: 매 specific direction.
- **Custom**: arbitrary aspect ratio.
#### 3. Remix Mode
- 매 image 의 variation.
- 매 prompt / parameter 의 modify.
- 매 region selection 와 combine.
#### 4. Upscale
- 매 resolution ↑ (e.g. 1024 → 4096).
- **Subtle Upscale**: simple resize (less detail).
- **Creative Upscale**: AI 의 매 detail / texture 추가.
- **ESRGAN / Real-ESRGAN**: open-source.
#### 5. Img2Img (Image-to-Image)
- 매 input image 의 prompt 에 영향.
- **Strength**: 0 (keep) - 1 (total change).
- 매 style transfer.
### Iterative refinement workflow
#### Stage 1: Generate base
- 매 prompt 의 initial generation.
- 매 batch (4-8 variant).
- 매 select best.
#### Stage 2: Identify defect
- 매 specific issue: extra finger, weird face, blur, ...
- 매 priority.
#### Stage 3: Inpaint each
- 매 mask + targeted prompt.
- 매 incremental fix.
#### Stage 4: Outpaint if needed
- 매 composition 의 extend.
- 매 narrative element 추가.
#### Stage 5: Upscale
- 매 final resolution.
- 매 detail enhancement.
→ 매 round 의 quality ↑.
### 매 platform 의 specific
#### Midjourney V7
- Vary (Region): mask + new prompt.
- Vary (Strong / Subtle): variation.
- Zoom Out (1.5x, 2x, custom).
- Pan (4 direction).
- Upscale (Subtle / Creative).
- Remix mode (Settings).
#### Stable Diffusion (ComfyUI / A1111)
- Inpainting (dedicated model: SD 1.5 inpaint, SDXL inpaint, Flux Fill).
- Outpainting (custom).
- Img2img (built-in).
- Upscale: Real-ESRGAN, 4x-UltraSharp, Latent.
- ControlNet (precise control).
#### DALL-E 3
- Edit (mask-based).
- Native chat-based UI.
- Limited compared to SD / Midjourney.
#### Adobe Firefly / Photoshop
- Generative Fill (inpainting).
- Generative Expand (outpainting).
- 매 layer-based workflow.
- 매 commercial license-safe.
#### Flux (modern)
- Flux.1 Fill (inpaint / outpaint dedicated).
- 매 SDXL 보다 좋은 quality.
### 매 technical detail
#### Mask quality
- 매 selection 의 surrounding context 도 include.
- 매 too tight = unnatural seam.
- 매 feathering (blur edge) = smoother blend.
#### Prompt for masked region
- 매 region 의 own prompt.
- 매 surrounding context 의 implicit (model 이 see).
- 매 style / lighting 의 match.
#### Strength / denoising
- Lower = preserve more.
- Higher = more freedom.
- Inpaint: 0.7-0.9 (strong change).
- Img2img: 0.3-0.6 (subtle).
#### CFG (guidance scale)
- 매 prompt adherence.
- 매 inpaint 의 7-12 typical.
### Common defect 의 specific fix
| Defect | Inpaint approach |
|---|---|
| Extra fingers | Mask hand + "perfect five-finger hand" |
| Asymmetric eyes | Mask both eyes + "symmetric eyes" |
| Watermark | Mask + "clean background" |
| Wrong color object | Mask + "red shirt" (specific color) |
| Background distraction | Mask background + "soft blur, depth of field" |
| Too dark / light | Mask + "balanced lighting" |
| Missing object | Mask area + "add cat sitting" |
| Style mismatch | Mask region + "oil painting style" |
### 매 advanced technique
#### Iterative inpaint chain
1. 매 inpaint round.
2. 매 next defect.
3. 매 다음 round.
→ 매 round 의 small change.
#### Multi-region edit
- 매 multiple mask 의 sequential.
- 매 prompt 의 region-specific.
#### Pose / composition fix
- ControlNet OpenPose 의 reference.
- 매 inpaint 의 pose-guided.
#### Style transfer (img2img)
- 매 photo → painting.
- 매 style 의 reference image (IP-Adapter).
#### Face restoration
- GFPGAN, CodeFormer.
- 매 face-specific model.
#### Detail upscale (Tile / Refine)
- 매 image 의 tile.
- 매 tile 의 separate enhance.
- 매 stitch.
→ 4K / 8K 의 quality ↑.
## 💻 코드 패턴 (Code Patterns)
### Inpainting (Diffusers SDXL)
```python
from diffusers import StableDiffusionXLInpaintPipeline
import torch
from PIL import Image
pipe = StableDiffusionXLInpaintPipeline.from_pretrained(
"diffusers/stable-diffusion-xl-1.0-inpainting-0.1",
torch_dtype=torch.float16,
).to("cuda")
original = Image.open("photo.png")
mask = Image.open("mask.png") # white = redo, black = keep
result = pipe(
prompt="clean wooden table, professional product shot",
image=original,
mask_image=mask,
num_inference_steps=30,
guidance_scale=7.5,
strength=0.85,
).images[0]
result.save("inpainted.png")
```
### Mask generation (programmatic)
```python
from PIL import Image, ImageDraw
def create_mask(image_size: tuple, region: tuple) -> Image.Image:
"""region = (x1, y1, x2, y2)"""
mask = Image.new('RGB', image_size, 'black')
draw = ImageDraw.Draw(mask)
draw.rectangle(region, fill='white')
return mask
# Usage
original_size = original.size
mask = create_mask(original_size, region=(100, 200, 400, 500))
```
### Mask with blur (smooth blend)
```python
from PIL import ImageFilter
mask = create_mask(image_size, region)
mask_blurred = mask.filter(ImageFilter.GaussianBlur(radius=10))
# 매 mask 의 edge 의 soft.
```
### Outpainting (Diffusers)
```python
from diffusers import StableDiffusionXLInpaintPipeline
import numpy as np
original = Image.open("photo.png")
W, H = original.size
# Create extended canvas (zoom out)
extended_size = (int(W * 1.5), int(H * 1.5))
extended = Image.new('RGB', extended_size, (128, 128, 128))
offset = ((extended_size[0] - W) // 2, (extended_size[1] - H) // 2)
extended.paste(original, offset)
# Mask: white = generate, black = keep
mask = Image.new('RGB', extended_size, 'white')
inner_mask = Image.new('RGB', (W, H), 'black')
mask.paste(inner_mask, offset)
result = pipe(
prompt="natural scene continuation, mountain landscape, cinematic",
image=extended,
mask_image=mask,
num_inference_steps=40,
guidance_scale=8,
).images[0]
```
### Upscale (Real-ESRGAN)
```python
from realesrgan import RealESRGANer
from basicsr.archs.rrdbnet_arch import RRDBNet
import torch
# 4x upscale
model = RRDBNet(num_in_ch=3, num_out_ch=3, num_feat=64, num_block=23, num_grow_ch=32, scale=4)
upscaler = RealESRGANer(
scale=4,
model_path='RealESRGAN_x4plus.pth',
model=model,
tile=400, # tile-based for big image
half=True,
)
import cv2
img = cv2.imread('output.png', cv2.IMREAD_UNCHANGED)
upscaled, _ = upscaler.enhance(img, outscale=4)
cv2.imwrite('upscaled.png', upscaled)
```
### ComfyUI workflow (visual node)
```
[LoadImage] → [VAEEncode] → [InpaintModel] → [KSampler] → [VAEDecode] → [SaveImage]
[LoadMask]
[PromptText (region)]
```
### Img2img (style transfer)
```python
from diffusers import StableDiffusionXLImg2ImgPipeline
pipe = StableDiffusionXLImg2ImgPipeline.from_pretrained("model")
result = pipe(
prompt="oil painting style, Renaissance, masterpiece",
image=original,
strength=0.6, # 매 less change
guidance_scale=7.5,
).images[0]
```
### Multi-stage workflow (orchestration)
```python
def refine_image(prompt: str) -> Image.Image:
# Stage 1: Generate
base = generate(prompt)
# Stage 2: Detect defects
issues = detect_issues(base)
# e.g., {'face': (200, 300, 400, 500), 'hand': (100, 100, 200, 200)}
# Stage 3: Inpaint each
current = base
for issue_type, region in issues.items():
mask = create_mask(current.size, region)
current = inpaint(current, mask, prompt=f"perfect {issue_type}")
# Stage 4: Upscale
final = upscale(current, scale=2)
return final
```
### Face restoration (GFPGAN)
```python
from gfpgan import GFPGANer
restorer = GFPGANer(
model_path='GFPGANv1.4.pth',
upscale=2,
arch='clean',
channel_multiplier=2,
bg_upsampler=upscaler,
)
cropped, restored, output = restorer.enhance(
img, has_aligned=False, only_center_face=False,
)
```
### IP-Adapter (style reference)
```python
from diffusers import StableDiffusionXLPipeline
from diffusers.utils import load_image
pipe = StableDiffusionXLPipeline.from_pretrained("model")
pipe.load_ip_adapter("h94/IP-Adapter", subfolder="sdxl_models", weight_name="ip-adapter-plus_sdxl_vit-h.safetensors")
pipe.set_ip_adapter_scale(0.6)
style_image = load_image("style_reference.jpg")
result = pipe(
prompt="portrait of a woman",
ip_adapter_image=style_image,
num_inference_steps=30,
).images[0]
```
→ 매 style of reference, 매 subject 의 your prompt.
### Photoshop Generative Fill (Adobe API)
```javascript
// Adobe Firefly Services API
const response = await fetch('https://firefly-api.adobe.io/v3/images/generative-fill', {
method: 'POST',
headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
image: { source: { url: 'https://...' } },
mask: { source: { url: 'https://...' } },
prompt: 'mountain landscape',
seeds: [1, 2, 3],
}),
});
```
### Batch refinement
```python
from concurrent.futures import ThreadPoolExecutor
def refine_one(image_url: str, defects: list[dict]) -> str:
image = download(image_url)
for d in defects:
image = inpaint(image, mask=d['mask'], prompt=d['prompt'])
return save(image)
with ThreadPoolExecutor(max_workers=4) as executor:
results = list(executor.map(lambda x: refine_one(x[0], x[1]), tasks))
```
## 🤔 의사결정 기준 (Decision Criteria)
| 작업 | 추천 도구 |
|---|---|
| Quick fix small region | Midjourney Vary (Region) |
| Photo retouching | Photoshop Generative Fill |
| Open / programmatic | Stable Diffusion + Diffusers |
| Style transfer | Img2img + IP-Adapter |
| Face restoration | GFPGAN / CodeFormer |
| Resolution ↑ | Real-ESRGAN / Creative Upscale |
| Composition extend | Outpainting (Pan / Zoom) |
| Multi-region | ComfyUI batch |
**기본값**: Generate base + iterate inpaint per defect + upscale final.
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
- **Mask quality 의 sensitivity**: 매 too tight = seam. 매 too loose = unrelated change.
- **Strength 의 trade-off**: 매 high = creative + match break. 매 low = preserve + change 부족.
- **Outpaint 의 logical continuation**: 매 model 의 surrounding scene understand 의 limit.
- **Upscale 의 hallucination**: 매 detail 의 add 가 not original.
- **Inpaint dedicated model vs general**: 매 dedicated 의 better.
## 🔗 지식 연결 (Graph)
- **Related Topics:** [[반복적 정교화 (Iterative Refinement)|반복적 정교화 (Iterative Refinement)]], [[인페인팅 및 아웃페인팅 (Inpainting and Outpainting)|인페인팅 및 아웃페인팅 (Inpainting and Outpainting)]], [[프롬프트 파라미터 제어 (Prompt Parameter Control)|프롬프트 파라미터 제어 (Prompt Parameter Control)]]
- **Projects/Contexts:** [[생성적 AI 이미징의 반복적 작업 프로세스 (Iterative Workflow of Generative AI Imaging)|생성적 AI 이미징의 반복적 작업 프로세스 (Iterative Workflow of Generative AI Imaging)]], [[미드저니 및 스테이블 디퓨전의 부분 편집 기법|미드저니 및 스테이블 디퓨전의 부분 편집 기법]]
- **Contradictions/Notes:** 편집하고자 하는 영역을 선택할 때, 선택 영역이 너무 작을 경우 AI가 주변 맥락을 파악하기 어려워 결과물이 부자연스러울 수 있으므로 충분한 맥락(Context)을 제공할 수 있을 만큼의 크기로 영역을 지정해야 한다는 실무적인 주의사항이 존재합니다 [2, 17].
---
*Last updated: 2026-04-30*
- 부모: [[AI-Image-Generation]] · [[Image-Editing]] · [[Diffusion-Models]]
- 변형: [[Inpainting]] · [[Outpainting]] · [[Img2Img]] · [[Upscale]] · [[ControlNet]]
- 응용: [[Photoshop-Generative-Fill]] · [[Midjourney-Vary-Region]] · [[ComfyUI-Workflow]]
- Tool: [[Diffusers-Library]] · [[Real-ESRGAN]] · [[GFPGAN]] · [[CodeFormer]] · [[IP-Adapter]] · [[Flux-Fill]]
- Adjacent: [[Image-Quality-Optimization-Debugging]] · [[Iterative-Refinement]] · [[Prompt-Engineering]]
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
**언제 이 지식을 쓰는가:**
- *(TODO)*
- 매 commercial image 의 fix.
- 매 product photo 의 background remove.
- 매 portrait 의 face / hand fix.
- 매 marketing material 의 multi-resolution.
- 매 art project 의 iterative refine.
**언제 쓰면 안 되는가:**
- *(TODO)*
- 매 from-scratch creation (use generation, not editing).
- Specific artist 의 unique style emulation (legal / ethical).
- Deepfake / impersonation (illegal).
- Print-quality (specialized print workflow).
## ❌ 안티패턴 (Anti-Patterns)
- **Mask 의 too tight**: seam.
- **모든 defect 의 single inpaint**: quality mix.
- **Img2img strength = 0.95**: 매 original 의 lose.
- **Upscale 의 too aggressive**: hallucinated detail.
- **No iterative review**: 매 1 pass + accept.
- **Outpaint 의 narrative break**: scene continuity.
- **Specific tool lock-in**: 매 limit 의 ignore.
## 🧪 검증 상태 (Validation)
- **정보 상태:** needs_review
- **출처 신뢰도:** A
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
- **정보 상태:** verified (concept-level).
- **출처 신뢰도:** B (Stability AI / Diffusers / Adobe Firefly / Midjourney documentation).
- **검토 이유:** Manual cleanup. 매 platform 의 evolution.
## 🧬 중복 검사 (Duplicate Check)
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
- **처리 방식:** UPDATE (자동 정규화)
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
- **과거 데이터와의 충돌:** 없음
- **정책 변화:** 없음
- **기존 유사 문서:** [[AI-Image-Generation]] (parent), [[AI 이미지 생성 및 편집 워크플로우]] (related), [[AI 이미지 품질 최적화]] (related).
- **처리 방식:** KEEP (focused on post-editing tools).
- **처리 이유:** Specific to refinement workflow.
## 🕓 변경 이력 (Changelog)
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|------|-----------|-----------|--------|
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
| 2026-05-08 | P-Reinforce Phase 1 정규화 | UPDATE | A |
| 2026-05-09 | Manual cleanup — 5 tool family + Diffusers code + multi-stage workflow + 안티패턴 추가 | UPDATE | B |