了解更多ChatGPT知识:ChatGPT与日本首相交流核废水事件-精准Prompt...
hello,我是小索奇,最近DALL再一次火爆,这里把官方图像生成的全部介绍给大家翻译成中文(双语),可以借鉴学习,一定是权威的。
这里把官方图像生成的全部介绍给大家翻译成中文(双语),可以借鉴学习,一定是权威的。
Image generation 图像生成
Learn how to generate or manipulate images with our DALL·E models了解如何使用我们的 DALL·E 型号
Introduction 介绍
The Images API provides three methods for interacting with images: 图像 API 提供了三种与图像交互的方法:
-
Creating images from scratch based on a text prompt 根据文本提示从头开始创建图像
-
Creating edits of an existing image based on a new text prompt 根据新的文本提示创建现有图像的编辑
-
Creating variations of an existing image 创建现有图像的变体
This guide covers the basics of using these three API endpoints with useful code samples. To see them in action, check out our DALL·E preview app. 本指南介绍了使用这三个 API 终结点的基础知识以及有用的代码示例。要了解它们的实际效果,请查看我们的 DALL·E 预览应用程序。
Usage 用法
Generations 代
The image generations endpoint allows you to create an original image given a text prompt. Generated images can have a size of 256x256, 512x512, or 1024x1024 pixels. Smaller sizes are faster to generate. You can request 1-10 images at a time using the n parameter.
图像生成终结点允许您在给定文本提示的情况下创建原始图像。生成的图像的大小可以是 256x256、512x512 或 1024x1024 像素。较小的尺寸生成速度更快。您可以使用 n 参数一次请求 1-10 张图像。
response = openai.Image.create(
prompt="a white siamese cat",
n=1,
size="1024x1024"
)
image_url = response['data'][0]['url']
The more detailed the description, the more likely you are to get the result that you or your end user want. You can explore the examples in the DALL·E preview app for more prompting inspiration. Here's a quick example:
描述越详细,就越有可能获得您或您的最终用户想要的结果。您可以在 DALL·E 预览应用程序,以获得更多提示灵感。下面是一个快速示例:
PROMPT 提示GENERATION 代
<