Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 629754c

Browse files
committed
➕ Add Python
1 parent eb0ad51 commit 629754c

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

‎Code/Edit-an-image.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
response = openai.Image.create_edit(
2+
image=open("sunlit_lounge.png", "rb"),
3+
mask=open("mask.png", "rb"),
4+
prompt="A sunlit indoor lounge area with a pool containing a flamingo",
5+
n=1,
6+
size="1024x1024"
7+
)
8+
image_url = response['data'][0]['url']

‎Code/generate-an-image.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
response = openai.Image.create(
2+
prompt="a happy dog",
3+
n=1,
4+
size="1024x1024"
5+
)
6+
image_url = response['data'][0]['url']

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /