Skip to content

Introducing image_generation to Jigsawstack-python: #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from

Conversation

Khurdhula-Harshavardhan
Copy link
Collaborator

  1. image_generation.py:
    • Defined params and response types for ImageGeneration.
    • Defined a new class/module for ImageGeneration & AsyncImageGeneration.
  2. request.py:
    • Since the response is bytes as type, and content-type is "image/png" within its headers, we introduce a new content-type before raising a parsing error, otherwise.
  3. jigsawstack:
    • Added ImageGeneration and AsyncImageGeneration to jigsawstack.

Sample usecase:

from jigsawstack import JigsawStack
jigsawstack = JigsawStack()

from pprint import pprint

import logging
logging.basicConfig(level=logging.DEBUG)
logging.getLogger("urllib3").setLevel(logging.DEBUG)

response = jigsawstack.image_generation(
    {"prompt": "A puppy playing in dog park."}
)

pprint(response)

import IPython.display as ipd
ipd.Image(response.content)

output

gitpichardo and others added 2 commits March 4, 2025 13:15
1. image_generation.py:
	- Defined params and response types for ImageGeneration.
	- Defined a new class/module for ImageGeneration & AsyncImageGeneration.
2. request.py:
	- Since the response is bytes as type, and content-type is "image/png" within its headers, we introduce a new content-type before raising a parsing error, otherwise.
3. jigsawstack:
	- Added ImageGeneration and AsyncImageGeneration to jigsawstack.
@Khurdhula-Harshavardhan Khurdhula-Harshavardhan added the enhancement New feature or request label Mar 5, 2025
@Khurdhula-Harshavardhan Khurdhula-Harshavardhan deleted the feat/image-generation branch March 7, 2025 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants