Automatic1111 프로바이더
Automatic1111 프로바이더
AUTOMATIC1111은 Stable Diffusion용으로 널리 쓰이는 웹 인터페이스로, 이미지 생성을 위한 폭넓은 기능을 제공해요. AI SDK용 Automatic1111 프로바이더는 로컬에서 호스팅되는 AUTOMATIC1111 인스턴스와 매끄럽게 연동하면서 고유한 장점을 제공해요:
- 로컬 제어 (Local Control): 로컬 Stable Diffusion 모델로 이미지 생성을 완전히 제어
- API 비용 없음 (No API Costs): 요청당 요금 없이 무제한 이미지 생성
- 모델 유연성 (Model Flexibility): 어떤 Stable Diffusion 체크포인트든 사용 가능
- 프라이버시 (Privacy): 모든 생성이 내 하드웨어에서 로컬로 진행
- 커뮤니티 모델 (Community Models): Civitai와 HuggingFace의 수천 개 커뮤니티 생성 모델에 접근
AUTOMATIC1111의 기능에 대해 더 알고 싶다면 AUTOMATIC1111 문서를 참고하세요.
출처: 문서
본문
설정 (Setup)
--api 플래그를 켠 상태로 AUTOMATIC1111을 실행해야 해요. AUTOMATIC1111 인스턴스를 다음과 같이 시작하세요:
# Windows
./webui.bat --api
# Linux/Mac
./webui.sh --api
Automatic1111 프로바이더는 automatic1111-provider 모듈에서 사용할 수 있어요. 다음과 같이 설치할 수 있어요:
# pnpm
pnpm add automatic1111-provider
# npm
npm install automatic1111-provider
# yarn
npm install automatic1111-provider
프로바이더 인스턴스 (Provider Instance)
Automatic1111 프로바이더 인스턴스를 만들려면 createAutomatic1111 함수를 사용하세요:
import { createAutomatic1111 } from 'automatic1111-provider';
const automatic1111 = createAutomatic1111({
baseURL: 'http://127.0.0.1:7860', // AUTOMATIC1111 인스턴스 주소
});
이미지 모델 (Image Models)
Automatic1111 프로바이더는 image() 메서드로 이미지 생성을 지원해요:
// 기본 이미지 생성
const imageModel = automatic1111.image('v1-5-pruned-emaonly');
// 커스텀 모델 사용
const sdxlModel = automatic1111.image('sd_xl_base_1.0');
예시 (Examples)
기본 이미지 생성 (Basic Image Generation)
import { automatic1111 } from 'automatic1111-provider';
import { generateImage } from 'ai';
const { images } = await generateImage({
model: automatic1111.image('v1-5-pruned-emaonly'),
prompt: 'A beautiful sunset over mountains',
size: '512x512',
});
고급 설정 (Advanced Configuration)
const { images } = await generateImage({
model: automatic1111.image('realistic-vision-v4'),
prompt: 'Portrait of a wise old wizard with a long beard',
n: 2,
seed: 12345,
providerOptions: {
automatic1111: {
negative_prompt: 'blurry, ugly, deformed, low quality',
steps: 40,
cfg_scale: 8.5,
sampler_name: 'DPM++ SDE Karras',
styles: ['photorealistic', 'detailed'],
check_model_exists: true,
},
},
});
프로바이더 옵션 (Provider Options)
Automatic1111 프로바이더는 이미지 생성을 커스터마이즈하기 위해 다음 옵션을 지원해요:
사용 가능한 옵션 (Available Options)
| 옵션 | 타입 | 기본값 | 설명 |
|---|---|---|---|
negative_prompt |
string |
undefined |
이미지에서 원하지 않는 것 |
steps |
number |
20 |
샘플링 단계 수 |
cfg_scale |
number |
7 |
CFG (Classifier Free Guidance) 스케일 |
sampler_name |
string |
"Euler a" |
샘플링 방법 |
denoising_strength |
number |
undefined |
img2img용 디노이징 강도 (0.0-1.0) |
styles |
string[] |
undefined |
미리 정의된 스타일 적용 |
check_model_exists |
boolean |
false |
생성 전에 모델 존재 여부 확인 |
모델 관리 (Model Management)
프로바이더는 AUTOMATIC1111 인스턴스에서 사용 가능한 모델을 자동으로 감지해요. 모델을 사용하려면:
.safetensors또는.ckpt모델 파일을models/Stable-diffusion/폴더에 넣으세요- AUTOMATIC1111을 재시작하거나 웹 인터페이스에서 모델 목록을 새로고침하세요
- 프로바이더에서 (파일 확장자 없는) 정확한 모델 이름을 사용하세요