Skip to content

Commit ce691dd

Browse files
author
Lin Fangyuan
committed
feat: seededit
1 parent bc7e7a7 commit ce691dd

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

volcenginesdkarkruntime/resources/images/images.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ def generate(
1616
*,
1717
model: str,
1818
prompt: str,
19+
image: str | None = None,
1920
response_format: str | None = None,
2021
size: str | None = None,
2122
seed: int | None = None,
2223
guidance_scale: float | None = None,
2324
watermark: bool | None = None,
25+
optimize_prompt: bool | None = None,
2426
extra_headers: Headers | None = None,
2527
extra_query: Query | None = None,
2628
extra_body: Body | None = None,
@@ -31,11 +33,13 @@ def generate(
3133
body={
3234
"model": model,
3335
"prompt": prompt,
36+
"image": image,
3437
"response_format": response_format,
3538
"size": size,
3639
"seed": seed,
3740
"guidance_scale": guidance_scale,
3841
"watermark": watermark,
42+
"optimize_prompt": optimize_prompt,
3943
},
4044
options=make_request_options(
4145
extra_headers=extra_headers,
@@ -56,11 +60,13 @@ async def generate(
5660
*,
5761
model: str,
5862
prompt: str,
63+
image: str | None = None,
5964
response_format: str | None = None,
6065
size: str | None = None,
6166
seed: int | None = None,
6267
guidance_scale: float | None = None,
6368
watermark: bool | None = None,
69+
optimize_prompt: bool | None = None,
6470
extra_headers: Headers | None = None,
6571
extra_query: Query | None = None,
6672
extra_body: Body | None = None,
@@ -71,11 +77,13 @@ async def generate(
7177
body={
7278
"model": model,
7379
"prompt": prompt,
80+
"image": image,
7481
"response_format": response_format,
7582
"size": size,
7683
"seed": seed,
7784
"guidance_scale": guidance_scale,
7885
"watermark": watermark,
86+
"optimize_prompt": optimize_prompt,
7987
},
8088
options=make_request_options(
8189
extra_headers=extra_headers,

volcenginesdkexamples/volcenginesdkarkruntime/async_image_generations.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111

1212

1313
async def main():
14-
print("----- async generate images -----")
14+
print("----- [Seedream] async generate images -----")
1515

1616
result = client.images.generate(
17-
model="${YOUR_ENDPOINT_ID}",
17+
model="${YOUR_SEEDREAM_ENDPOINT_ID}",
1818
prompt="龙与地下城女骑士背景是起伏的平原,目光从镜头转向平原",
1919
seed=1234567890,
2020
watermark=True,
@@ -24,5 +24,19 @@ async def main():
2424

2525
print(await result)
2626

27+
print("----- [Seededit] async generate images async -----")
28+
29+
result = client.images.generate(
30+
model="${YOUR_SEEDEDIT_ENDPOINT_ID}",
31+
prompt="龙与地下城女骑士背景是起伏的平原,目光从镜头转向平原",
32+
image="https://an-test-imgs.tos-cn-beijing.volces.com/avi/9m_001.jpg",
33+
seed=1234567890,
34+
watermark=True,
35+
size="adaptive",
36+
guidance_scale=2.5,
37+
)
38+
39+
print(await result)
40+
2741
if __name__ == "__main__":
2842
asyncio.run(main())

0 commit comments

Comments
 (0)