3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

初めに

前回に引き続き、openAIのGPT3を用いて画像生成を行いました。
https://qiita.com/Yu_unI1/items/112deff0583884cd2d85

実装

image.py
import os
import openai

import configparser

config_ini = configparser.ConfigParser()
config_ini.read('config.ini', encoding='utf-8')

openai.api_key = config_ini['GPT']['API_KEY']

response = openai.Image.create(
    prompt="A girl using laptop",
    n=1,
    size="1024x1024"
)

print(response)

promptに入れたキーワードから画像を生成してくれるようです。詳しいアルゴリズムはこちらの記事に綺麗にまとまっています!
https://gigazine.net/news/20200729-how-gpt-3-work/

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?