Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

AISmithLab/Moderator

Open more actions menu

Repository files navigation

Moderator: Moderating Text-to-Image Diffusion Models through Fine-grained Context-based Policies

1-Prerequisite

1-1-Install environment

cd Moderator
conda env create --prefix moderator --file moderator.yaml
conda activate moderator

Install diffuser module from GitHub.

1-2-Initialize the environment

chmod +x ./init.sh
bash ./init.sh

1-3-Install Ollama and pull Llama3

curl -fsSL https://ollama.com/install.sh | sh
ollama pull llama3

1-4-Export Work Dir

export ModeratorWordDir="Input your work dir, the original dir for the clone."

2-Quick Start

2-1-Run the test

First run the command below to start the backend

python main_backend.py

This will start a backend on flask on http://127.0.0.1:7417/ It will provide several interfaces:

  • pretrain_img_generate: Pass the prompt to generate images on pretrained models. See example in AE_policy_result.py
  • img_generate: Pass the prompt to generate images on moderated models. See example in AE_policy_result.py
  • craft_config: Pass the config to generate policy. See example in AE_policy_craft.py You can craft scripts to use the interfaces, and you can also use our frontend interface.

Then you can access http://localhost:7417/index to use the frontend interface.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Morty Proxy This is a proxified and sanitized view of the page, visit original site.