feat(docs/client.md): add base64 response format for image generation

This commit is contained in:
kqlio67 2024-10-28 10:36:45 +02:00
parent 61e74deb0f
commit 72e8152853

View file

@ -154,7 +154,7 @@ from g4f.client import Client
client = Client()
response = client.images.generate(
model="dall-e-3",
model="flux",
prompt="a white siamese cat"
# Add any other necessary parameters
)
@ -164,6 +164,23 @@ image_url = response.data[0].url
print(f"Generated image URL: {image_url}")
```
#### Base64 Response Format
```python
from g4f.client import Client
client = Client()
response = client.images.generate(
model="flux",
prompt="a white siamese cat",
response_format="b64_json"
)
base64_text = response.data[0].b64_json
print(base64_text)
```
### Creating Image Variations