> ## Documentation Index
> Fetch the complete documentation index at: https://docs.playbook3d.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Python SDK

Playbook's Python SDK integrates any python application with ComfyUI. It allows you to quickly create images and videos using generative diffusion models.

[Get the Python SDK](https://github.com/playbook3d/playbook3d-python-sdk)

## How To Use Playbook's Python SDK

<Steps>
  <Step title="Install our SDK">
    <b>Pip install is here!</b>. You can install Playbook3d via

    ```python theme={"dark"}
    pip install playbook3d
    ```
  </Step>

  <Step title="Import the sdk">
    Import the sdk into your code with:

    ```python theme={"dark"}
    from playbook3d.playbookNetworkClient import PlaybookClient
    ```
  </Step>

  <Step title="Initialize the client">
    Create an Initialize function and set your api key: <br />

    ```python theme={"dark"}
    def setup_playbook_client(self):
        self.playbookClient = PlaybookClient()
        self.playbookClient.set_api_key({"insert your api key here"})
    ```
  </Step>
</Steps>

## Creating a run

After you pull data from the sdk, you can queue a generation using:

```python theme={"dark"}
self.playbookClient.run_workflow(PlaybookRun: run)
```

## Getting your results

You can either get your results from the [Playbook webclient](https://beta.playbook3d.com) logging in with the same account or by calling:

```python theme={"dark"}
self.playbookClient.get_run_result({PlaybookRun: run})
```
