> For the complete documentation index, see [llms.txt](https://docs.chamilo.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chamilo.org/teacher-guide/teacher-guide/ai-tools/ai-media-generation.md).

# AI Media Generation

When editing a document in the **Documents** tool, the AI media generation feature lets you produce an **image** or a **short video** to illustrate a paragraph — directly from the rich-text editor (WYSIWYG), without leaving the document.

## Requirements

* AI helpers are enabled at the platform level
* At least one AI media provider (image or video) is configured by the administrator
* The feature is allowed in your course (course-level permission must be enabled)

## How to Generate an Image or Video

1. Open a document in the **Documents** <img src="https://2111850333-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fti3Ac0vWGXg7lrHAYz3r%2Fuploads%2Fgit-blob-8f7e3e3fa5fec6c8a5de49121594ce6d587aa3a4%2Fmdi-bookshelf.svg?alt=media" alt="Documents" data-size="line"> tool (create a new one or edit an existing one)
2. In the rich-text editor, place your cursor in or near the paragraph you want to illustrate
3. Open the **Generate AI media** dialog from the editor toolbar
4. Describe what you want the media to show, or use the selected paragraph as the prompt
5. Choose whether to generate an **image** or a **video**
6. Click **Generate** and wait for the AI to produce the result
7. Preview the generated media and, if satisfied, click **Insert** to embed it in the document

## Tips

* **Write a clear prompt** — The more specific your description, the more relevant the output. Include style cues (e.g. "diagram", "illustration", "realistic photo") if the provider supports them
* **Always review before inserting** — Generated media may not perfectly match your intent; regenerate or adjust the prompt if needed
* **Keep file sizes in mind** — Generated images and videos count against the course storage quota. Remove unused media from the document library if space is limited
* **Video generation takes longer** — Short video generation can take significantly more time than image generation; plan accordingly if you are near a deadline
