/prompt_translator

A stable diffusion extension for translating prompts from 50 languages. The objective is to give users the possibility to use their own language to perform text prompting.

Primary LanguagePythonMIT LicenseMIT

prompt_translator

Prompt_translator is an extension for Stable Diffusion Web UI (sd_webui), which adds an automatic translation tool to the Gradio UI. This tool allows users to generate images based on prompts written in 50 different languages.

Installation

To install prompt_translator, clone the repository or extract the zip file to the extensions folder of the sd_webui mother application.

Usage

After installing prompt_translator, a new entry will be added to the Gradio UI. To use the automatic translation tool, click the "Load Translation Model" button to load the translation model. The translation model used in this tool is the mbart-large-50-one-to-many-mmt model developed by Meta (formerly Facebook). You can find more information about the model on its Hugging Face model card. Once the model is loaded, a dropdown UI will be displayed, where the user can select the source language of their prompt.

The user can then write their prompt in the desired language and press the "Generate" button to generate the image. The prompt will automatically be translated to English, and the resulting image will look as described in the text.

Here are some screenshots of the extension in work:

image image

Using the X/Y/Z script, we can test changing words in another language. Here is French image

License

This project is licensed under the MIT license.

Contributing

Contributions to prompt_translator are welcome! If you find a bug or have an idea for a new feature, please create an issue on the project's GitHub page. If you'd like to contribute code, please fork the repository, make your changes, and submit a pull request.