Is there anyway to dowload full size image #72

Open
opened 2026-02-13 17:27:46 -06:00 by mirrors · 8 comments
Owner

Originally created by @nvcc1701 on GitHub (Jul 4, 2025).

Is there anyway to save image like download full size in the gemini ui. I see that image.save() has lower resolution than download full size.

    for i, image in enumerate(response.images):
        await image.save(path="temp/", filename=f"image_{i}.png", verbose=True)
        print(i, image)
Image
Originally created by @nvcc1701 on GitHub (Jul 4, 2025). Is there anyway to save image like download full size in the gemini ui. I see that image.save() has lower resolution than download full size. ``` for i, image in enumerate(response.images): await image.save(path="temp/", filename=f"image_{i}.png", verbose=True) print(i, image) ``` <img width="1005" height="522" alt="Image" src="https://github.com/user-attachments/assets/f9bb7e72-9510-41f5-a719-2d561eab9fbd" />
Author
Owner

@HanaokaYuzu commented on GitHub (Jul 4, 2025):

Fixed in v1.14.2.

Now calling GeneratedImage.save will automatically download image in full size. You can optionally pass full_size=False to save 512*512 preview version instead.

@HanaokaYuzu commented on GitHub (Jul 4, 2025): Fixed in v1.14.2. Now calling `GeneratedImage.save` will automatically download image in full size. You can optionally pass `full_size=False` to save 512*512 preview version instead.
Author
Owner

@nvcc1701 commented on GitHub (Jul 5, 2025):

Fixed in v1.14.2.

Now calling GeneratedImage.save will automatically download image in full size. You can optionally pass full_size=False to save 512*512 preview version instead.

It seem like download full size not work. When i test download, the url of gemini_api is
url from gemini-api
but when i save in gemini ui it is like
url from gemini.google.com
and the size is not same, gemini-api(1408x768), gemini.google.com(2816×1536)

@nvcc1701 commented on GitHub (Jul 5, 2025): > Fixed in v1.14.2. > > Now calling `GeneratedImage.save` will automatically download image in full size. You can optionally pass `full_size=False` to save 512*512 preview version instead. It seem like download full size not work. When i test download, the url of gemini_api is [url from gemini-api](https://lh3.googleusercontent.com/gg-dl/AJfQ9KR6Z6JyKYNufOgalmcj-_EbfH4A6xell53V4x4uTZfInmdLWRYmfk_KO9iBstExpf-NaE1twG6cTkqDLbmMElGYrRhIUSE4_9ebgVHSJqh1QYGreRi5UJ2JAGwPryCpbf6WG8fvK5pXkXiwgVl6WYGsBaptVuuyc_JH0fXSqQPuv-rE0A=s2048) but when i save in gemini ui it is like [url from gemini.google.com]( https://lh3.googleusercontent.com/fife/ALs6j_H5rqShZOzFMXVaoBV3cQZ8YMKO0tW0QfyaE77lfGvzdz4ZCMFn0_l2q3bSy_FcSHFiZEF-uJv-3xQowLZ6t8s2_5JIn-i5E6yPT1MxeBgcmzMMchn5LHFDQWhj81Tz2KyCShKudD-BiYatoYSXqkUHMDiUK8xWiyew_3Sc3Ltv_z_-TivUbSA6QJB6ZKKkiUmhGm-9Uut-0x15z6DMgj-oIU92qregsBP_FfcolBs9mWxhFP3q7jvF7wA28LxnSU4TFu6B6d5U13XpZsIJrvU8DoAR3EToey2TMFLGASA3fVxIQtFRTmBXuLDLu_sDtXvNDIeI2Djr1pO3tD9G6aXQIU6Qh98_xESY58vVaR5vPxds4XkMxQqGJaDJnq6IW6mHW2J8QaoQWAxlgiaEkAZ6OlX6C_Sgbzq8pBVlQGcetesmWG7hliDHzv-rMW_sqKylvGfic1lkzPOCJG_tyxTnGsuQqsYhCRW-h1kQ24RWLw-N2mtzJlkmjQ1eeiy4K4t7KUJzujhSMyjIXldsZAnKX-xWmeeuHCJatFKBI83FhIvZKfc-7h-QcNAsieYANip2jBGCjkqA7f-ly_MHB4J_zAYaIaoW5AGVcjEnr7_1Wf_oJ6Y5CkLkJGY0DQ1kHAC0qq_VKaTELgjh97-gcXtGFad6U6Ome91ef0Az3q_v78KHc3pHrdIUannliM9mtSVh_g4Mm6HtcX5hu0Ez-9LAqvcuIxIofealhVSQAnIjLy8RfJ97n68T1cRwaCzHazeT4jHailtWI-4gzolI1xIEhj7_i9obziC4nznQLci3jCJN4Ntm8ANDDjfz3T7YLZS6mon_gMR-utpmpgHGaJFqC_Y8tTRydD8dsGGdGWJ5FWQwLTWgAiz0ei3XsA_bq5rZEpBVbAdJg2swX7dEE3h2FUfk-9Rmnxczwx8gyQWAx1OuUz81ILeaB2Sd8GrsskpWdH_gOJcON5fyuLBqHIT6VX1KZDkYc5C_PJtPS-FOccqSUr8TO5HUNpl58k_IMwo7Mu-Fg4msvS7ClZpG0jdkjYDNxeCTZATMYr6S1FHazkHEprPJIDle_4DPVPWWsFBwhrOAFSQieQZA7kzRTj53kwUSqQp-fdzxmvB8XD4PdE82qmr9w2BWnuISKP8zx1Qr0G4AlXxwMDYnbRuZafwP8SxxDcpGfXx6gYOTKf-TIQbZXWycQTTBmjV31w0_ZeI_5whslKOIe4rtmX38R0jnt_K6vV3rUDqEjz_EPgj6yh_P2Kr_kLeYEyhXoeon1Iavv3h8i0NTKmytEEZJDLp5TikB7xizPAOA2xddCX06cuW9ZBTNqlmj9avhXOMuSoFth0v4xNUPpKO5OiMLzefj-61fpPG07k-wyqtLiK4EjEbF8PlmMIoZmDrjhsGNPIlLqXIqhhMFOjDoU2JMYpT2oQ=s0-d?alr=yes) and the size is not same, gemini-api(1408x768), gemini.google.com(2816×1536)
Author
Owner

@HanaokaYuzu commented on GitHub (Jul 6, 2025):

Probably due to your generated image has max width greater than 2048px. Could you please try modifying the following line locally to self.url += "=s4096" and check if it works?

github.com/HanaokaYuzu/Gemini-API@4aba81ffa2/src/gemini_webapi/types/image.py (L161)

@HanaokaYuzu commented on GitHub (Jul 6, 2025): Probably due to your generated image has max width greater than 2048px. Could you please try modifying the following line locally to `self.url += "=s4096"` and check if it works? https://github.com/HanaokaYuzu/Gemini-API/blob/4aba81ffa2035ae8bb28389ce2e30c702a2305f9/src/gemini_webapi/types/image.py#L161
Author
Owner

@nvcc1701 commented on GitHub (Jul 6, 2025):

Probably due to your generated image has max width greater than 2048px. Could you please try modifying the following line locally to self.url += "=s4096" and check if it works?

Gemini-API/src/gemini_webapi/types/image.py

Line 161 in 4aba81f

self.url += "=s2048"

I have tested add =s4096 it not work, it have same result like s2048. The dowload full size in gemini.google.com have higher resolution.

@nvcc1701 commented on GitHub (Jul 6, 2025): > Probably due to your generated image has max width greater than 2048px. Could you please try modifying the following line locally to `self.url += "=s4096"` and check if it works? > > [Gemini-API/src/gemini_webapi/types/image.py](https://github.com/HanaokaYuzu/Gemini-API/blob/4aba81ffa2035ae8bb28389ce2e30c702a2305f9/src/gemini_webapi/types/image.py#L161) > > Line 161 in [4aba81f](/HanaokaYuzu/Gemini-API/commit/4aba81ffa2035ae8bb28389ce2e30c702a2305f9) > > self.url += "=s2048" I have tested add `=s4096` it not work, it have same result like `s2048`. The dowload full size in gemini.google.com have higher resolution.
Author
Owner

@HanaokaYuzu commented on GitHub (Jul 6, 2025):

Can you send me the prompt you used to generate the image?

@HanaokaYuzu commented on GitHub (Jul 6, 2025): Can you send me the prompt you used to generate the image?
Author
Owner

@nvcc1701 commented on GitHub (Jul 6, 2025):

Can you send me the prompt you used to generate the image?

Yes.

    response = await client.generate_content(
        "Ảnh con chó Kích thước z16:9.",
        model=Model.G_2_5_FLASH,
    )
@nvcc1701 commented on GitHub (Jul 6, 2025): > Can you send me the prompt you used to generate the image? Yes. ``` response = await client.generate_content( "Ảnh con chó Kích thước z16:9.", model=Model.G_2_5_FLASH, ) ```
Author
Owner

@HanaokaYuzu commented on GitHub (Jul 6, 2025):

So what's behind the scenes is that Google uses a "2-step" generation for every image generation request. When you send prompts in chat, the first step is triggered and a 1080p image will be generated and returned; then when the user clicks "download", another RPC will be called to trigger the second step which generates the 2k version.

This works pretty well to provide a more smooth experience on the user side as well as save cost by splitting the expensive and time-consuming generation process into 2 parts, but from the perspective of gemini_webapi, those messy RPC calls could be challenging to implement into the API and I'm still hesitating whether to integrate them into the package. That's also the reason why deep research (#80) and video generation (#84, #109) is not implemented yet: these functions all rely on extra RFCs besides a single generation request (that's how GeminiClient.generate_content works currently).

In short, I'll leave this issue open for now, while as the user base grows up probably I'll find a time to implement these features one day.

@HanaokaYuzu commented on GitHub (Jul 6, 2025): So what's behind the scenes is that Google uses a "2-step" generation for every image generation request. When you send prompts in chat, the first step is triggered and a 1080p image will be generated and returned; then when the user clicks "download", another RPC will be called to trigger the second step which generates the 2k version. This works pretty well to provide a more smooth experience on the user side as well as save cost by splitting the expensive and time-consuming generation process into 2 parts, but from the perspective of `gemini_webapi`, those messy RPC calls could be challenging to implement into the API and I'm still hesitating whether to integrate them into the package. That's also the reason why deep research (#80) and video generation (#84, #109) is not implemented yet: these functions all rely on extra RFCs besides a single generation request (that's how `GeminiClient.generate_content` works currently). In short, I'll leave this issue open for now, while as the user base grows up probably I'll find a time to implement these features one day.
Author
Owner

@nvcc1701 commented on GitHub (Jul 8, 2025):

So what's behind the scenes is that Google uses a "2-step" generation for every image generation request. When you send prompts in chat, the first step is triggered and a 1080p image will be generated and returned; then when the user clicks "download", another RPC will be called to trigger the second step which generates the 2k version.

This works pretty well to provide a more smooth experience on the user side as well as save cost by splitting the expensive and time-consuming generation process into 2 parts, but from the perspective of gemini_webapi, those messy RPC calls could be challenging to implement into the API and I'm still hesitating whether to integrate them into the package. That's also the reason why deep research (#80) and video generation (#84, #109) is not implemented yet: these functions all rely on extra RFCs besides a single generation request (that's how GeminiClient.generate_content works currently).

In short, I'll leave this issue open for now, while as the user base grows up probably I'll find a time to implement these features one day.

It's Great feature, hope to use it soon

@nvcc1701 commented on GitHub (Jul 8, 2025): > So what's behind the scenes is that Google uses a "2-step" generation for every image generation request. When you send prompts in chat, the first step is triggered and a 1080p image will be generated and returned; then when the user clicks "download", another RPC will be called to trigger the second step which generates the 2k version. > > This works pretty well to provide a more smooth experience on the user side as well as save cost by splitting the expensive and time-consuming generation process into 2 parts, but from the perspective of `gemini_webapi`, those messy RPC calls could be challenging to implement into the API and I'm still hesitating whether to integrate them into the package. That's also the reason why deep research ([#80](https://github.com/HanaokaYuzu/Gemini-API/issues/80)) and video generation ([#84](https://github.com/HanaokaYuzu/Gemini-API/issues/84), [#109](https://github.com/HanaokaYuzu/Gemini-API/issues/109)) is not implemented yet: these functions all rely on extra RFCs besides a single generation request (that's how `GeminiClient.generate_content` works currently). > > In short, I'll leave this issue open for now, while as the user base grows up probably I'll find a time to implement these features one day. It's Great feature, hope to use it soon
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mirrors/Gemini-API#72
No description provided.