# How YAML Manifests Drive OpenMontage's Pipeline Configuration System

> Discover how YAML manifests define OpenMontage pipeline configurations, model parameters, and styles. Customize video generation workflows declaratively without touching Python code.

- Repository: [Calesthio/OpenMontage](https://github.com/calesthio/OpenMontage)
- Tags: internals
- Published: 2026-08-30

---

**YAML manifests in OpenMontage serve as declarative playbooks that define pipeline configurations, model parameters, and visual styles, allowing users to customize video generation workflows without modifying Python source code.**

OpenMontage utilizes YAML manifests to externalize pipeline configuration from application logic. These configuration files, located in the `styles/` directory, specify everything from diffusion model selections to rendering parameters. The [`playbook_loader.py`](https://github.com/calesthio/OpenMontage/blob/main/playbook_loader.py) module parses these manifests at runtime using `yaml.safe_load`, converting them into Python dictionaries that drive the video generation engine.

## Anatomy of an OpenMontage YAML Manifest

### The Pipeline Configuration Section

Every YAML playbook contains a top-level `pipeline` key that defines the core generation workflow. This section specifies the pipeline name (e.g., `image_to_video` or `video_to_video`), the target diffusion model, and inference parameters including `steps`, `guidance_scale`, and `seed`.

In [`styles/premium-minimalist.yaml`](https://github.com/calesthio/OpenMontage/blob/main/styles/premium-minimalist.yaml), the pipeline section configures a `stable-diffusion-v2` model with 50 inference steps and a guidance scale of 7.5. Conversely, [`styles/flat-motion-graphics.yaml`](https://github.com/calesthio/OpenMontage/blob/main/styles/flat-motion-graphics.yaml) specifies a `video_to_video` pipeline using the `motion-gen-v1` model with 60 steps and a guidance scale of 8.0.

### The Styles Configuration Section

The `styles` section controls visual presentation elements consumed by downstream rendering components. This includes **background colors**, **font selections**, and **animation speeds**.

For example, [`styles/anime-ghibli.yaml`](https://github.com/calesthio/OpenMontage/blob/main/styles/anime-ghibli.yaml) sets the background color to `#ffcc00` and specifies `Comic Sans MS` for typography, while [`styles/clean-professional.yaml`](https://github.com/calesthio/OpenMontage/blob/main/styles/clean-professional.yaml) configures Times New Roman fonts and company logo paths. The [`styles/minimalist-diagram.yaml`](https://github.com/calesthio/OpenMontage/blob/main/styles/minimalist-diagram.yaml) manifest includes a `line_width` parameter specific to diagram rendering.

## Loading and Executing YAML Playbooks

### The playbook_loader.py Interface

The [`styles/playbook_loader.py`](https://github.com/calesthio/OpenMontage/blob/main/styles/playbook_loader.py) module provides two primary functions for manifest interaction:

- **`load_playbook(name: str) -> dict`**: Constructs a file path from the `PLAYBOOKS_DIR` constant (defined as `Path(__file__).parent`), validates the file's existence using `is_file()`, and returns the parsed YAML content as a dictionary via `yaml.safe_load`.
- **`list_playbooks() -> list`**: Returns a list of available playbook stems by globbing the `styles/` directory for `*.yaml` files using `PLAYBOOKS_DIR.glob("*.yaml")`.

### Runtime Integration

During execution, OpenMontage calls `load_playbook()` to retrieve configuration dictionaries. The returned data structure contains nested dictionaries under `pipeline` and `styles` keys, which the application uses to initialize model pipelines and configure rendering backends. This architecture enables hot-swapping of configurations by simply modifying YAML files without restarting the Python interpreter or redeploying code.

## Working with OpenMontage YAML Manifests

### Loading a Specific Configuration

To load a playbook programmatically, import the loader utility and specify the base filename without the `.yaml` extension:

```python
from styles.playbook_loader import load_playbook

# Load the premium-minimalist configuration

config = load_playbook("premium-minimalist")

# Access model configuration

model_name = config["pipeline"]["model"]  # "stable-diffusion-v2"

guidance = config["pipeline"]["parameters"]["guidance_scale"]  # 7.5

```

### Enumerating Available Playbooks

The system supports dynamic discovery of available styles through the `list_playbooks()` function:

```python
from styles.playbook_loader import list_playbooks

available_styles = list_playbooks()
print(available_styles)

# Output: ['anime-ghibli', 'clean-professional', 'flat-motion-graphics', 

#          'minimalist-diagram', 'premium-minimalist']

```

### Accessing Nested Parameters

Once loaded, the manifest exposes model-specific parameters through nested dictionary access:

```python
manifest = load_playbook("flat-motion-graphics")
pipeline_config = manifest["pipeline"]

operation = pipeline_config["name"]  # "video_to_video"

model_id = pipeline_config["model"]  # "motion-gen-v1"

inference_params = pipeline_config["parameters"]  # Dict with steps, seed, etc.

```

## Summary

- OpenMontage YAML manifests separate configuration from code, residing in the `styles/` directory alongside [`playbook_loader.py`](https://github.com/calesthio/OpenMontage/blob/main/playbook_loader.py).
- Each manifest defines `pipeline` settings (model selection, operation type, inference parameters) and `styles` settings (visual presentation attributes).
- The [`playbook_loader.py`](https://github.com/calesthio/OpenMontage/blob/main/playbook_loader.py) module provides `load_playbook()` and `list_playbooks()` for runtime manifest management using `yaml.safe_load`.
- Configuration changes take effect immediately without code redeployment, supporting workflows ranging from `image_to_video` to `video_to_video` generation.
- Available playbooks include `premium-minimalist`, `minimalist-diagram`, `flat-motion-graphics`, `clean-professional`, and `anime-ghibli`.

## Frequently Asked Questions

### What is the file structure of an OpenMontage YAML manifest?

Standard manifests contain two primary top-level sections: `pipeline` (specifying model selection, operation type such as `image_to_video`, and inference parameters like `steps` and `guidance_scale`) and `styles` (defining visual attributes such as `background_color`, `font`, and animation properties).

### How does OpenMontage load YAML configuration files?

The system uses the `load_playbook()` function implemented in [`styles/playbook_loader.py`](https://github.com/calesthio/OpenMontage/blob/main/styles/playbook_loader.py), which constructs file paths relative to the module's parent directory, validates file existence, and parses content using `yaml.safe_load()` to return standard Python dictionaries for runtime consumption.

### Can I create custom YAML playbooks for OpenMontage?

Yes, users can create new manifests by adding `.yaml` files to the `styles/` directory with valid `pipeline` and `styles` sections. The `list_playbooks()` function automatically discovers new files by globbing the directory, requiring no modifications to the Python source code to recognize additional configurations.

### What pipeline operations are supported in OpenMontage manifests?

According to the source manifests in the repository, supported operations include `image_to_video` (utilized in `premium-minimalist`, `minimalist-diagram`, `clean-professional`, and `anime-ghibli` styles) and `video_to_video` (utilized in `flat-motion-graphics`), each pairing with specific diffusion models like `stable-diffusion-v2` or `motion-gen-v1`.