yuanflow-cli 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -122,6 +122,8 @@ yuanflow-cli oss copy --source-key temp/cover.png --target-key final/cover.png -
|
|
|
122
122
|
- 生成图片:`/v1/images/generations`,主模型 `gpt-image-2-c`,备用模型 `gpt-image-2`,请求体使用 `prompt`。
|
|
123
123
|
- 编辑图片:`/v1/images/edits`,必须使用 multipart/form-data 上传本地图片文件。
|
|
124
124
|
- `gpt-image-2-c` 通常返回 URL,`gpt-image-2` 通常返回 `b64_json`;两种返回都应缓存后再展示。
|
|
125
|
+
- 生成图片必填参数:`prompt`。可选参数:`size`(默认 `1024x1024`)、`quality`(默认 `standard`)、`style`(默认 `vivid`)、`n`(默认 `1`,范围 `1~10`)、`response_format`(默认 `url`)。
|
|
126
|
+
- 编辑图片除 `prompt` 外还必须上传本地图片文件,Skill 内使用 `image_path` 表示本地文件路径,实际请求以 `multipart/form-data` 的 `image` 字段上传。
|
|
125
127
|
|
|
126
128
|
## Skill 安装器
|
|
127
129
|
|
package/package.json
CHANGED
|
@@ -18,7 +18,11 @@ description: Use when the user asks to generate images, create pictures, make po
|
|
|
18
18
|
"mode": "generate",
|
|
19
19
|
"model": "gpt-image-2-c",
|
|
20
20
|
"prompt": "一张写实产品图:白色马克杯放在木桌上,自然光",
|
|
21
|
-
"size": "1024x1024"
|
|
21
|
+
"size": "1024x1024",
|
|
22
|
+
"quality": "standard",
|
|
23
|
+
"style": "vivid",
|
|
24
|
+
"n": 1,
|
|
25
|
+
"response_format": "url"
|
|
22
26
|
}
|
|
23
27
|
```
|
|
24
28
|
|
|
@@ -50,6 +54,29 @@ description: Use when the user asks to generate images, create pictures, make po
|
|
|
50
54
|
- `gpt-image-2` 通常返回 `b64_json` 图片数据。
|
|
51
55
|
- 两种返回都需要缓存成本地资源,并在最终回复中给出可显示的图片链接。
|
|
52
56
|
|
|
57
|
+
## 参数说明
|
|
58
|
+
|
|
59
|
+
生成图片参数:
|
|
60
|
+
|
|
61
|
+
| 参数 | 必填 | 类型 | 默认值 | 说明 |
|
|
62
|
+
| --- | --- | --- | --- | --- |
|
|
63
|
+
| `prompt` | 是 | `string` | 无 | 想要生成图像的文字描述。 |
|
|
64
|
+
| `size` | 否 | `enum` | `1024x1024` | 输出图像尺寸。 |
|
|
65
|
+
| `quality` | 否 | `enum` | `standard` | 生成质量预设。 |
|
|
66
|
+
| `style` | 否 | `enum` | `vivid` | 画风。 |
|
|
67
|
+
| `n` | 否 | `integer` | `1` | 生成的图像数量,范围 `1~10`。 |
|
|
68
|
+
| `response_format` | 否 | `enum` | `url` | 图像结果的返回方式。 |
|
|
69
|
+
|
|
70
|
+
编辑图片参数:
|
|
71
|
+
|
|
72
|
+
| 参数 | 必填 | 类型 | 默认值 | 说明 |
|
|
73
|
+
| --- | --- | --- | --- | --- |
|
|
74
|
+
| `image_path` / `image` | 是 | 本地文件 | 无 | 被编辑的本地图片,必须通过 `multipart/form-data` 以文件上传。 |
|
|
75
|
+
| `prompt` | 是 | `string` | 无 | 想要修改图片的文字描述。 |
|
|
76
|
+
| `model` | 否 | `enum` | `gpt-image-2-c` | 优先使用 `gpt-image-2-c`,失败后再尝试 `gpt-image-2`。 |
|
|
77
|
+
| `size` | 否 | `enum` | `1024x1024` | 输出图像尺寸。 |
|
|
78
|
+
| `response_format` | 否 | `enum` | `url` | 图像结果的返回方式。 |
|
|
79
|
+
|
|
53
80
|
## 外部 Agent 或手工调用
|
|
54
81
|
|
|
55
82
|
生成图片请求示例:
|
|
@@ -60,7 +87,12 @@ curl https://open.yuanchuangai.com/v1/images/generations \
|
|
|
60
87
|
-H "Content-Type: application/json" \
|
|
61
88
|
-d '{
|
|
62
89
|
"model": "gpt-image-2-c",
|
|
63
|
-
"prompt": "一张写实产品图:白色马克杯放在木桌上,自然光"
|
|
90
|
+
"prompt": "一张写实产品图:白色马克杯放在木桌上,自然光",
|
|
91
|
+
"size": "1024x1024",
|
|
92
|
+
"quality": "standard",
|
|
93
|
+
"style": "vivid",
|
|
94
|
+
"n": 1,
|
|
95
|
+
"response_format": "url"
|
|
64
96
|
}'
|
|
65
97
|
```
|
|
66
98
|
|