diff options
author | kqlio67 <kqlio67@users.noreply.github.com> | 2024-10-28 09:36:45 +0100 |
---|---|---|
committer | kqlio67 <kqlio67@users.noreply.github.com> | 2024-10-28 09:36:45 +0100 |
commit | 72e8152853386bc40842c8150187b9b0a38426af (patch) | |
tree | d6b845ef494916817e258abed7c0ae7ae74923fa /docs/client.md | |
parent | docs(docs/async_client.md): update G4F async client API guide (diff) | |
download | gpt4free-72e8152853386bc40842c8150187b9b0a38426af.tar gpt4free-72e8152853386bc40842c8150187b9b0a38426af.tar.gz gpt4free-72e8152853386bc40842c8150187b9b0a38426af.tar.bz2 gpt4free-72e8152853386bc40842c8150187b9b0a38426af.tar.lz gpt4free-72e8152853386bc40842c8150187b9b0a38426af.tar.xz gpt4free-72e8152853386bc40842c8150187b9b0a38426af.tar.zst gpt4free-72e8152853386bc40842c8150187b9b0a38426af.zip |
Diffstat (limited to 'docs/client.md')
-rw-r--r-- | docs/client.md | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/docs/client.md b/docs/client.md index 9621e3c2..b4f351d3 100644 --- a/docs/client.md +++ b/docs/client.md @@ -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 |