Skip to content

Commit 76f3d05

Browse files
committed
feat: Update changelog, version bump, and add streaming option. Fixes #53 Fixes #55
1 parent aad7c02 commit 76f3d05

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

docs/CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,4 +571,10 @@ For instance:
571571

572572
**What's new?**
573573

574-
- feat: Termux extra installation options : `termux-cli`, `termux-api` and `termux-all`
574+
- feat: Termux extra installation options : `termux-cli`, `termux-api` and `termux-all`
575+
576+
## v0.7.4
577+
578+
**What's new?**
579+
580+
- fix : Image generation failure.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656

5757
setup(
5858
name="python-tgpt",
59-
version="0.7.3",
59+
version="0.7.4",
6060
license="MIT",
6161
author="Smartwa",
6262
maintainer="Smartwa",

src/pytgpt/console.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2415,9 +2415,15 @@ class ImageGen:
24152415
help="Disable prompt altering for effective image generation",
24162416
)
24172417
@click.option("-q", "--quiet", is_flag=True, help="Suppress progress bar")
2418+
@click.option(
2419+
"-s",
2420+
"--stream",
2421+
help="Stream the image download process.",
2422+
is_flag=True,
2423+
)
24182424
@click.help_option("-h", "--help")
24192425
def generate_image(
2420-
prompt, provider, directory, amount, name, timeout, proxy, no_additives, quiet
2426+
prompt, provider, directory, amount, name, timeout, proxy, no_additives, quiet, stream
24212427
):
24222428
"""Generate images with pollinations.ai"""
24232429
provider_obj = this.image_providers_map.get(provider)
@@ -2427,12 +2433,12 @@ def generate_image(
24272433
total=amount,
24282434
visible=quiet == False,
24292435
)
2430-
imager = provider_obj(timeout=timeout, proxies=proxy if proxy else {})
2436+
imager:Prodia | Imager = provider_obj(timeout=timeout, proxies=proxy if proxy else {})
24312437
for image in imager.generate(
24322438
prompt=prompt,
24332439
amount=amount,
24342440
additives=no_additives == False,
2435-
stream=True,
2441+
stream=stream, # Just a hack for temporary save. Raises "'async_generator' object is not iterable"
24362442
):
24372443
imager.save([image], name=name, dir=directory)
24382444
progress.update(task, advance=1)

0 commit comments

Comments
 (0)