@@ -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