返回提交历史
Modified
docs/client.md
+18
-1
XFEstudio/gpt4free
feat(docs/client.md): add base64 response format for image generation
72e81528
代码差异
1 个文件
+18
-1
@@ -154,7 +154,7 @@ from g4f.client import Client
154
154
client = Client()
155
155
156
156
response = client.images.generate(
157
model="dall-e-3",
157
model="flux",
158
158
prompt="a white siamese cat"
159
159
# Add any other necessary parameters
160
160
)
@@ -164,6 +164,23 @@ image_url = response.data[0].url
164
164
print(f"Generated image URL: {image_url}")
165
165
```
166
166
167
168
#### Base64 Response Format
169
```python
170
from g4f.client import Client
171
172
client = Client()
173
174
response = client.images.generate(
175
model="flux",
176
prompt="a white siamese cat",
177
response_format="b64_json"
178
)
179
180
base64_text = response.data[0].b64_json
181
print(base64_text)
182
```
183
167
184
168
185
169
186
### Creating Image Variations