검색
검색
공개 노트 검색
회원가입로그인

[Stable Diffusion 3] API 키로 Colab 에서 사용해 보기 (튜토리얼)

요약
  • Stable Diffusion 3와 Turbo API를 구글 콜랩에서 사용하는 방법을 소개합니다.
  • Stability.ai에서 API 키를 발급받아 Google Colaboratory에서 Stable Diffusion 모델을 사용할 수 있습니다.
  • 프롬프트, 네거티브 프롬프트, 비율, 이미지 포맷을 선택하여 이미지를 생성하는 과정을 설명합니다.

download

(Stable Diffusion 3, prompt: Vincent Van Gogh, Starry Night)

Stable Diffusion 3 와 Turbo API 구글 콜랩에서 사용하는 방법에 대해서 간단하게 설명드리겠습니다.

틸노트 개발자이신 glevel 님께서 관련 내용을 잘 정리해 주셨습니다.

스테이블 디퓨전 3가 API 로 공개되었네요. + 사용해 보기

[Stable Diffusion 3]  API 키로 Colab 에서 사용해 보기 (튜토리얼) image 2

가입하면 25 크레딧을 공짜로 줍니다. 다 소진한 이후에는 10달러에 1000크레딧을 충전해서 사용해야 합니다.

  • SD3는 1MP 이미지당 6.5 크레딧, Turbo는 4 크레딧이 소모됩니다.

- Stable Diffusion 모델 가중치를 Self-Host하려면 Stability.ai 멤버십이 필요합니다.

- Stability.ai의 Stable Assistant Beta도 새로운 컨텐츠 생성 도구로 활용할 수 있습니다.

- Fireworks AI 플랫폼에서도 다양한 AI 모델을 API로 제공하고 있습니다.

1. 계정생성

😀 Stability.ai 계정을 만들고 API 키를 발급받으세요. https://platform.stability.ai에서 가입 후 API 키를 생성하세요.

Stability AI - Developer Platform

😀 상단의 documentation 탭을 클릭하고 Getting Started> Stable Image 를 클릭하여 문서를 엽니다.

[Stable Diffusion 3]  API 키로 Colab 에서 사용해 보기 (튜토리얼) image 3

😀 구글 콜랩에서 새 노트북을 엽니다.

[Stable Diffusion 3]  API 키로 Colab 에서 사용해 보기 (튜토리얼) image 4

😀 예시 이미지 하단에 Image Services 에서 "Open in Colab"을 클릭하여 Colab 으로 들어갑니다.

Google Colaboratory (여기를 클릭하셔도 됩니다)

[Stable Diffusion 3]  API 키로 Colab 에서 사용해 보기 (튜토리얼) image 5

😀 상단의 "파일"을 클릭하여 "Drive 에 사본저장을 눌러서 나의 구글 드라이브에 복사본을 저장합니다.

[Stable Diffusion 3]  API 키로 Colab 에서 사용해 보기 (튜토리얼) image 6

[Stable Diffusion 3]  API 키로 Colab 에서 사용해 보기 (튜토리얼) image 7

😀 차례대로 각 셀에서 command + enter // ctrl + enter 를 눌러서 셀을 실행합니다.

[Stable Diffusion 3]  API 키로 Colab 에서 사용해 보기 (튜토리얼) image 8

😀 Stability ai 메인 페이지에서 오른쪽 자신의 프로필 사진을 클릭하여 API Keys 를 복사합니다.

[Stable Diffusion 3]  API 키로 Colab 에서 사용해 보기 (튜토리얼) image 9

[Stable Diffusion 3]  API 키로 Colab 에서 사용해 보기 (튜토리얼) image 10

😀 다시 Colab 으로 돌아와서 "Connect to the Stability API 의 셀을 ctrl + enter 를 눌러 실행시키고 Enter your API Key 의 공백에 복사한 API 키를 붙여넣습니다.

[Stable Diffusion 3]  API 키로 Colab 에서 사용해 보기 (튜토리얼) image 11

😀 프롬프트, 네거티브프롬프트, 비율, 이미지 포멧을 선택하고 셀을 실행시킵니다.

[Stable Diffusion 3]  API 키로 Colab 에서 사용해 보기 (튜토리얼) image 12

😀 프롬프트 생성이 고민이 되실까봐 스테이블 디퓨전 3의 프롬프트를 자동으로 생성해주는 지피티스를 만들어 놓았으니 자유롭게 사용하시기 바랍니다.

ChatGPT - SD 3 Prompt Generator

프롬프트: vincent van gogh, starry night

Here’s a prompt suggestion for generating an image inspired by an iconic fight scene reminiscent of the "Demon Slayer" style, using Stable Diffusion 3:

Main Prompt: "A dynamic and visually striking fight scene in a mystical forest, featuring two characters with supernatural abilities. One character wields a glowing sword with intricate designs, wearing a traditional demon slayer outfit, while the other is a demon with sharp, ethereal features and a menacing aura. The background is dense with ancient trees, mist, and soft light filtering through the leaves. The scene captures the intensity and drama typical of Japanese animation."

Negative Prompt: "Avoid modern elements, avoid non-anime style characters, do not include graphic violence or gore."

Aspect Ratio: "1792x1024" – suitable for capturing the wide, cinematic scope of a fight scene.

Seed: 385726 – to ensure the randomness in generation contributes to a unique but consistent artistic style.

Output Format: "PNG" – for high-quality image reproduction.

Description: This prompt is designed to create an image that embodies the essence of an epic fight scene from a Japanese anime like "Demon Slayer." The focus is on supernatural elements, a mystical setting, and the dramatic interaction between a heroic character and a demon, all portrayed in a style that is true to Japanese animation aesthetics. The chosen aspect ratio helps in capturing the broad scope of action, while the seed number aids in maintaining visual consistency across generations.

[Stable Diffusion 3]  API 키로 Colab 에서 사용해 보기 (튜토리얼) image 13

품질이 나쁘지 않은 것 같습니다.

몇 장 그리지 않았는데 벌써 크레딧이 소진되고 말았습니다. 아직은 매우 비싸다는 평이 맞는 것 같습니다.

[Stable Diffusion 3]  API 키로 Colab 에서 사용해 보기 (튜토리얼) image 14

조회수 : 771
공유하기
카카오로 공유하기
페이스북 공유하기
트위터로 공유하기
url 복사하기
T
Chat
페이지 기반 대답