Skip to content
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

Update sdk with additional features #11

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 8 additions & 73 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ The SDK needs to be configured with an API key which is available [here](https:/

```python
from imagine import Imagine
from imagine.styles import GenerationsStyle
from imagine.models import Status
from imagine.enums import Styles
from imagine.enums import Status

# Initialize the Imagine client with your API token
client = Imagine(token="your-api-token")
Expand All @@ -42,7 +42,7 @@ response = client.generations(
A vibrant and whimsical fantasy forest with magical creatures, glowing plants,
and a flowing river, in a digital painting style inspired by video games like Ori and the Blind Forest.
''',
style=GenerationsStyle.IMAGINE_V5,
style=Styles.Generations.IMAGINE_V5,
)

# Check if the request was successful
Expand All @@ -61,11 +61,11 @@ else:

The Imagine class acts as a facade, providing an interface to interact with all of our endpoints. It currently provides the following features:

- **Text-To-Image**: `generations() -> Response[Image]`
- **Image-Remix**: `image_remix() -> Response[Image]`
- **Super-Resolution**: `super_resolution() -> Response[Image]`
- **Variations**: `variations() -> Response[Image]` (_Currently Not Supported_)
- **In-Painting**: `in_painting() -> Response[Image]` (_Currently Not Supported_)
- **Generations**: `generations() -> Response[Image]`
- **Background**: `background() -> Response[Image]`
- **Edits**: `edits() -> Response[Image]`
- **Enhance**: `enhance() -> Response[Image]`
- **Face**: `face() -> Response[Image]`

For the full list of parameters and other details, check out the [documentation](https://vyroai.notion.site/API-Documentation-e643af82991f4265841cff2951eac803).

Expand Down Expand Up @@ -108,71 +108,6 @@ The module is loaded dynamically and is not included in the default package, you

The module is loaded dynamically and is not included in the default package, you can choose to forgo this dependency. [See this](#integration-with-other-libraries) for more information.

### Some More Usage Examples

#### Variations

> Currently Not Supported

```python
from imagine import Imagine
from imagine.styles import GenerationsStyle
from imagine.models import Status

# Initialize the Imagine client with your API token
client = Imagine(token="your-api-token")

# Generate an image using the variations feature
response = client.variate(
image_path="anime_girl.png",
prompt="a cute anime girl in a forest",
style=GenerationStyle.ANIME,
)

# Check if the request was successful
if response.status == Status.OK:
image = response.data
image.as_file("result.png")
else:
print(f"Status Code: {response.status.value}")
```

**Result**:

![Variate](https://vyroai.notion.site/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F7a2a54f2-c762-45ea-a1bd-c655ed421caa%2Fbanner_2.png?table=block&id=d60f4549-e35c-4044-afaa-7cd9d17803a2&spaceId=60572bb8-cbeb-42ba-b882-c88845384d44&width=2000&userId=&cache=v2)

#### In-Painting

> Currently Not Supported

```python
from imagine import Imagine
from imagine.styles import InPaintingStyle
from imagine.models import Status

# Initialize the Imagine client with your API token
client = Imagine(token="your-api-token")

# Generate an image using the in_painting feature
response = client.in_painting(
image_path="couple.png",
mask_path="mask.png",
prompt="woman sitting next to a teddy bear",
style=InPaintingStyle.BASIC,
)

# Check if the request was successful
if response.status == Status.OK:
image = response.data
image.as_file("result.png")
else:
print(f"Status Code: {response.status.value}")

```

**Result**:
![InPainting](https://vyroai.notion.site/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F7017cedd-aeda-4a3e-ad09-54eb8b93399d%2Finpainting.jpg?table=block&id=1bc58f0f-1d7f-465f-b414-200ceb2464b1&spaceId=60572bb8-cbeb-42ba-b882-c88845384d44&width=2000&userId=&cache=v2)

## Integration With Other Libraries

The Imagine SDK has two levels of dependencies. By default, only the requests library is shipped as a dependency. If you want to use Pillow and Numpy as well, execute the following command:
Expand Down
21 changes: 21 additions & 0 deletions docs/imagine.constants.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
imagine.constants package
=========================

Submodules
----------

imagine.constants.filters module
--------------------------------

.. automodule:: imagine.constants.filters
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: imagine.constants
:members:
:undoc-members:
:show-inheritance:
53 changes: 53 additions & 0 deletions docs/imagine.enums.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
imagine.enums package
=====================

Submodules
----------

imagine.enums.aspect\_ratio module
----------------------------------

.. automodule:: imagine.enums.aspect_ratio
:members:
:undoc-members:
:show-inheritance:

imagine.enums.controls module
-----------------------------

.. automodule:: imagine.enums.controls
:members:
:undoc-members:
:show-inheritance:

imagine.enums.filters module
----------------------------

.. automodule:: imagine.enums.filters
:members:
:undoc-members:
:show-inheritance:

imagine.enums.status module
---------------------------

.. automodule:: imagine.enums.status
:members:
:undoc-members:
:show-inheritance:

imagine.enums.styles module
---------------------------

.. automodule:: imagine.enums.styles
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: imagine.enums
:members:
:undoc-members:
:show-inheritance:
21 changes: 21 additions & 0 deletions docs/imagine.features.background.remover.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
imagine.features.background.remover package
===========================================

Submodules
----------

imagine.features.background.remover.handler module
--------------------------------------------------

.. automodule:: imagine.features.background.remover.handler
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: imagine.features.background.remover
:members:
:undoc-members:
:show-inheritance:
29 changes: 29 additions & 0 deletions docs/imagine.features.background.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
imagine.features.background package
===================================

Subpackages
-----------

.. toctree::
:maxdepth: 4

imagine.features.background.remover

Submodules
----------

imagine.features.background.handler module
------------------------------------------

.. automodule:: imagine.features.background.handler
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: imagine.features.background
:members:
:undoc-members:
:show-inheritance:
21 changes: 21 additions & 0 deletions docs/imagine.features.edits.filters.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
imagine.features.edits.filters package
======================================

Submodules
----------

imagine.features.edits.filters.handler module
---------------------------------------------

.. automodule:: imagine.features.edits.filters.handler
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: imagine.features.edits.filters
:members:
:undoc-members:
:show-inheritance:
21 changes: 21 additions & 0 deletions docs/imagine.features.edits.inpaint.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
imagine.features.edits.inpaint package
======================================

Submodules
----------

imagine.features.edits.inpaint.handler module
---------------------------------------------

.. automodule:: imagine.features.edits.inpaint.handler
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: imagine.features.edits.inpaint
:members:
:undoc-members:
:show-inheritance:
21 changes: 21 additions & 0 deletions docs/imagine.features.edits.remix.remix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
imagine.features.edits.remix.remix package
==========================================

Submodules
----------

imagine.features.edits.remix.remix.handler module
-------------------------------------------------

.. automodule:: imagine.features.edits.remix.remix.handler
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: imagine.features.edits.remix.remix
:members:
:undoc-members:
:show-inheritance:
29 changes: 29 additions & 0 deletions docs/imagine.features.edits.remix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
imagine.features.edits.remix package
====================================

Subpackages
-----------

.. toctree::
:maxdepth: 4

imagine.features.edits.remix.remix

Submodules
----------

imagine.features.edits.remix.handler module
-------------------------------------------

.. automodule:: imagine.features.edits.remix.handler
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: imagine.features.edits.remix
:members:
:undoc-members:
:show-inheritance:
31 changes: 31 additions & 0 deletions docs/imagine.features.edits.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
imagine.features.edits package
==============================

Subpackages
-----------

.. toctree::
:maxdepth: 4

imagine.features.edits.filters
imagine.features.edits.inpaint
imagine.features.edits.remix

Submodules
----------

imagine.features.edits.handler module
-------------------------------------

.. automodule:: imagine.features.edits.handler
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: imagine.features.edits
:members:
:undoc-members:
:show-inheritance:
29 changes: 29 additions & 0 deletions docs/imagine.features.enhance.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
imagine.features.enhance package
================================

Subpackages
-----------

.. toctree::
:maxdepth: 4

imagine.features.enhance.upsacle

Submodules
----------

imagine.features.enhance.handler module
---------------------------------------

.. automodule:: imagine.features.enhance.handler
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: imagine.features.enhance
:members:
:undoc-members:
:show-inheritance:
Loading