Skip to content

Commit

Permalink
feat: Update changelog, version bump, and add streaming option. Fixes #…
Browse files Browse the repository at this point in the history
…53 Fixes #55
  • Loading branch information
Simatwa committed Jul 6, 2024
1 parent aad7c02 commit 76f3d05
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
8 changes: 7 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -571,4 +571,10 @@ For instance:

**What's new?**

- feat: Termux extra installation options : `termux-cli`, `termux-api` and `termux-all`
- feat: Termux extra installation options : `termux-cli`, `termux-api` and `termux-all`

## v0.7.4

**What's new?**

- fix : Image generation failure.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

setup(
name="python-tgpt",
version="0.7.3",
version="0.7.4",
license="MIT",
author="Smartwa",
maintainer="Smartwa",
Expand Down
12 changes: 9 additions & 3 deletions src/pytgpt/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -2415,9 +2415,15 @@ class ImageGen:
help="Disable prompt altering for effective image generation",
)
@click.option("-q", "--quiet", is_flag=True, help="Suppress progress bar")
@click.option(
"-s",
"--stream",
help="Stream the image download process.",
is_flag=True,
)
@click.help_option("-h", "--help")
def generate_image(
prompt, provider, directory, amount, name, timeout, proxy, no_additives, quiet
prompt, provider, directory, amount, name, timeout, proxy, no_additives, quiet, stream
):
"""Generate images with pollinations.ai"""
provider_obj = this.image_providers_map.get(provider)
Expand All @@ -2427,12 +2433,12 @@ def generate_image(
total=amount,
visible=quiet == False,
)
imager = provider_obj(timeout=timeout, proxies=proxy if proxy else {})
imager:Prodia | Imager = provider_obj(timeout=timeout, proxies=proxy if proxy else {})
for image in imager.generate(
prompt=prompt,
amount=amount,
additives=no_additives == False,
stream=True,
stream=stream, # Just a hack for temporary save. Raises "'async_generator' object is not iterable"
):
imager.save([image], name=name, dir=directory)
progress.update(task, advance=1)
Expand Down

0 comments on commit 76f3d05

Please sign in to comment.