File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed
volcenginesdkexamples/volcenginesdkarkruntime Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ def generate(
125125 sequential_image_generation : str | None = None ,
126126 sequential_image_generation_options : SequentialImageGenerationOptions | None = None ,
127127 stream : Optional [Literal [False ]] | Literal [True ] | NotGiven = NOT_GIVEN ,
128- ) -> ImagesResponse :
128+ ) -> ImagesResponse | Stream [ ImageGenStreamEvent ] :
129129 resp = self ._post (
130130 "/images/generations" ,
131131 body = {
Original file line number Diff line number Diff line change @@ -33,6 +33,9 @@ class Image(BaseModel):
3333 b64_json : str
3434 """The Base 64 encoded string of the generated image, if any."""
3535
36+ size : str
37+ """The size of the generated image, if any."""
38+
3639
3740class Error (BaseModel ):
3841 message : str
Original file line number Diff line number Diff line change 2424 print ("----- [Seededit] generate images -----" )
2525
2626 result = client .images .generate (
27- model = "${YOUR_SEEDEDIT_ENDPOINT_ID }" ,
27+ model = "${YOUR_SEEDREAM_ENDPOINT_ID }" ,
2828 prompt = "龙与地下城女骑士背景是起伏的平原,目光从镜头转向平原" ,
29- image = "${YOUR_IMAGE_URL}" ,
29+ # image="${YOUR_IMAGE_URL}",
3030 seed = 1234567890 ,
3131 watermark = True ,
32- size = "adaptive " ,
32+ size = "1024x1024 " ,
3333 )
3434
3535 print (result )
4040 model = "${YOUR_SEEDREAM_ENDPOINT_ID}" ,
4141 prompt = "星球大战, 需要三幅图片描绘不同的战斗场景" ,
4242 response_format = "url" ,
43- image = ["YOUR_IMAGE_URL_HERE" , "YOUR_IMAGE_URL_HERE" ],
43+ # image=["YOUR_IMAGE_URL_HERE", "YOUR_IMAGE_URL_HERE"],
4444 seed = 1234567890 ,
4545 watermark = True ,
4646 size = "1024x1024" ,
6666 if event .error is None :
6767 print ("Final completed event:" )
6868 print ("recv.Usage:" , event .usage )
69-
70- elif event .type == "image_generation.partial_image" :
71- print (f"Partial image index={ event .partial_image_index } , size={ len (event .b64_json )} " )
You can’t perform that action at this time.
0 commit comments