# Restoring Layer Generation Configuration

When Fater generates an image layer using an AI model, it often stores the **parameters and the AI model used** to create that specific layer. The **"Restore Layer Config"** feature allows you to quickly recall these settings, making it easier to iterate, try variations, or reproduce a similar result.

***

### When is Configuration Stored?

* Most layers generated by AI models in the **Image Editor** (e.g., via Text-to-Image, Inpainting, Controlled Generation, Upscaling) will have their generation `params` (parameters) and `source` (the AI model ID) saved as part of the layer's metadata.
* This does *not* apply to layers created manually (e.g., empty layers, uploaded images that haven't been processed by AI within Fater).

***

### How to Restore Layer Configuration

1. **Identify the Layer:** In the **Layers Tab**, find the AI-generated layer whose settings you want to restore.
2. **Check for "Restore" Icon:** If the layer has stored configuration, a **"Restore Layer Config"** icon (`ListRestart` 🔄) will be visible on its item in the Layers Tab. If this icon is not present, configuration cannot be restored for that layer. *(Placeholder: Add screenshot)*
3. **Click the Icon:** Click the `ListRestart` 🔄 icon on that specific layer item.

***

### What Happens When You Restore Configuration:

When you click "Restore Layer Config":

1. **Model Selection:** The **AI Model Selector** in the Left Sidebar will automatically switch to the `source` model that was originally used to generate that layer.
2. **Parameter Update:** The parameters in the Left Sidebar (e.g., Prompt, Negative Prompt, Steps, Guidance, Style Type, specific model controls) will be updated to match the `params` stored with the layer, **with a specific behavior for the Seed.**

**Important Note on Seed Restoration:**

The Seed value from the original generation is handled in a specific way to facilitate iteration:

* **First Click (or if other parameters changed since last restore):**
  * All parameters (Prompt, Steps, Guidance, etc.) from the stored layer configuration are applied to the Left Sidebar controls.
  * The **Seed will be set to Random (-1)** by default. This allows you to immediately generate a *new variation* using the restored parameters but with a fresh random starting point.
* **Second Consecutive Click (if no other parameters were changed):**
  * If you click the "Restore Layer Config" icon for the **same layer again**, and you **have not altered any other model parameters** in the Left Sidebar since the first click, Fater will then also apply the **original Seed** that was stored with the layer.
  * This second click effectively "locks in" the original seed, allowing you to attempt to reproduce the exact previous result or make very minor tweaks to the prompt while keeping the same underlying seed.

This two-step seed restoration logic (first click for new variation with restored params, second click to also restore original seed) is designed to give you flexibility in your iterative workflow.

***

### Current Limitations & Best Practices:

* **Does NOT Restore Canvas State:** This feature restores the AI model and its parameters. It does **not** automatically restore:
  * The **Generation Area Bounding Box** to what it was when the layer was originally created.
  * The **exact canvas content (other layers' visibility/state) or mask** that was present during the original generation.
* **Implication for Using Static Seeds:** If you are trying to perfectly reproduce an image (typically after the second click that restores the original seed), you must also **manually ensure** that the Generation Area, active mask, and the visible content of other layers are as close as possible to the original conditions. Otherwise, even with the same model, parameters, and seed, the output can differ due to the different visual input the AI "sees."

**Use Cases:**

* Quickly revisiting a previous successful generation's settings to try new variations (first click).
* Attempting to reproduce a specific past result by restoring all settings including the seed (second click, after ensuring canvas state is similar).
* Troubleshooting or comparing different parameter sets.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://fater.gitbook.io/fater-ai-docs/working-with-layers/restoring-layer-generation-configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
