Home

Awesome

<p align="center"> <img src="https://user-images.githubusercontent.com/57536852/297959777-1ba4ae57-6309-447f-b1f1-0b3331e6f347.gif" alt="ENFUGUE Web UI v0.3.3"> </p> <h3 align="center">ENFUGUE is an open-source web app for making studio-grade images and video using generative AI.</h3> <p align="center"><i>For server or desktop, beginners or pros.</i></p> <p align="center"><b>New - Come visit the <a href="https://discord.gg/TT7RTnhfed" target="_blank">Discord!</a></b></p> <hr /> <p align="center"> <img src="https://img.shields.io/static/v1?label=painebenjamin&message=app.enfugue.ai&color=ff3366&logo=github" alt="painebenjamin - app.enfugue.ai"> <a href="https://discord.gg/TT7RTnhfed" target="_blank"><img src="https://img.shields.io/discord/1182768218079772672?style=flat&color=ff3366&logo=discord&logoColor=ffffff&label=Discord" alt="discord"></a> <img src="https://img.shields.io/github/stars/painebenjamin/app.enfugue.ai?style=social" alt="stars - app.enfugue.ai"> <img src="https://img.shields.io/github/forks/painebenjamin/app.enfugue.ai?style=social" alt="forks - app.enfugue.ai"><br /> <a href="https://github.com/painebenjamin/app.enfugue.ai/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-GPL3-ff3366" alt="License"></a> <a href="https://github.com/painebenjamin/app.enfugue.ai/releases/"><img src="https://img.shields.io/github/tag/painebenjamin/app.enfugue.ai?include_prereleases=&sort=semver&color=ff3366" alt="GitHub tag"></a> <a href="https://github.com/painebenjamin/app.enfugue.ai/releases/"><img alt="GitHub release (with filter)" src="https://img.shields.io/github/v/release/painebenjamin/app.enfugue.ai?color=ff3366"></a> <a href="https://pypi.org/project/enfugue"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/enfugue?color=ff3366"></a> <a href="https://github.com/painebenjamin/app.enfugue.ai/releases/"><img alt="GitHub all releases" src="https://img.shields.io/github/downloads/painebenjamin/app.enfugue.ai/total?logo=github&color=ff3366"></a> <a href="https://pypi.org/project/enfugue"><img alt="PyPI - Downloads" src="https://img.shields.io/pypi/dm/enfugue?logo=python&logoColor=white&color=ff3366"></a> </p> <div align="center"> <a href="https://github.com/painebenjamin/app.enfugue.ai/assets/57536852/28b4bc57-ab6c-4c83-b1cb-b8c16332779d" target="_blank"><img src="https://github.com/painebenjamin/app.enfugue.ai/assets/57536852/28b4bc57-ab6c-4c83-b1cb-b8c16332779d" width="260" /></a> <a href="https://github.com/painebenjamin/app.enfugue.ai/assets/57536852/7ec7528d-de24-4c08-b5d0-061dcc675e21" target="_blank"><img src="https://github.com/painebenjamin/app.enfugue.ai/assets/57536852/7ec7528d-de24-4c08-b5d0-061dcc675e21" width="260" /></a> <a href="https://github.com/painebenjamin/app.enfugue.ai/assets/57536852/2215ef54-d820-4e78-869d-330eee5f297c" target="_blank"><img src="https://github.com/painebenjamin/app.enfugue.ai/assets/57536852/2215ef54-d820-4e78-869d-330eee5f297c" width="260" /></a> <br /> <a href="https://github.com/painebenjamin/app.enfugue.ai/assets/57536852/f0bca178-9a50-45f8-94a3-fa54cabf23bd" target="_blank"><img src="https://github.com/painebenjamin/app.enfugue.ai/assets/57536852/f0bca178-9a50-45f8-94a3-fa54cabf23bd" width="260" /></a> <a href="https://github.com/painebenjamin/app.enfugue.ai/assets/57536852/7e1adeb3-642a-43b0-9a2b-b244d50fa44b" target="_blank"><img src="https://github.com/painebenjamin/app.enfugue.ai/assets/57536852/7e1adeb3-642a-43b0-9a2b-b244d50fa44b" width="260" /></a> <a href="https://github.com/painebenjamin/app.enfugue.ai/assets/57536852/1596f720-e609-4e24-ab1d-c90a34821687" target="_blank"><img src="https://github.com/painebenjamin/app.enfugue.ai/assets/57536852/1596f720-e609-4e24-ab1d-c90a34821687" width="260" /></a> <br /> <a href="https://github.com/painebenjamin/app.enfugue.ai/assets/57536852/85749fca-dd0b-47e3-a491-6d6219168bb0" target="_blank"><img src="https://github.com/painebenjamin/app.enfugue.ai/assets/57536852/85749fca-dd0b-47e3-a491-6d6219168bb0" width="260" /></a> <a href="https://github.com/painebenjamin/app.enfugue.ai/assets/57536852/98a6ac73-9b03-446c-91b2-9d09d6ce428a" target="_blank"><img src="https://github.com/painebenjamin/app.enfugue.ai/assets/57536852/98a6ac73-9b03-446c-91b2-9d09d6ce428a" width="260" /></a> <a href="https://github.com/painebenjamin/app.enfugue.ai/assets/57536852/44a7c5fb-87f0-4594-a8ee-f54de7e8f46d" target="_blank"><img src="https://github.com/painebenjamin/app.enfugue.ai/assets/57536852/44a7c5fb-87f0-4594-a8ee-f54de7e8f46d" width="260" /></a> <br /> <em>Views of the ENFUGUE user interface in various configurable themes, click to view full-size.</em> </div><br />

Feature Summary

Installation and Running

A script is provided for Windows and Linux machines to install, update, and run ENFUGUE. Copy the relevant command below and answer the on-screen prompts to choose your installation type and install optional dependencies.

Windows

Access the command prompt from the start menu by searching for "command." Alternatively, hold the windows key on your keyboard and click x, then press r or click run, then type cmd and press enter or click ok.

curl https://raw.githubusercontent.com/painebenjamin/app.enfugue.ai/main/enfugue.bat -o enfugue.bat
.\enfugue.bat

Linux

curl https://raw.githubusercontent.com/painebenjamin/app.enfugue.ai/main/enfugue.sh -o enfugue.sh
chmod u+x enfugue.sh
./enfugue.sh

Both of these commands accept the same flags.

USAGE: enfugue.(bat|sh) [OPTIONS]
Options:
 --help                   Display this help message.
 --conda / --portable     Automatically set installation type (do not prompt.)
 --update / --no-update   Automatically apply or skip updates (do not prompt.)
 --mmpose / --no-mmpose   Automatically install or skip installing MMPose (do not prompt.)

Manual Installation

If you want to install without using the installation scripts, see this Wiki page.

Configuration

Many configuration options are available, but none are required. If you want to specify things such as the host and port that the server listens on, please review the documentation for this on this Wiki page.

Application Usage

Accessing the UI

By default, the UI deploys two servers, one with and without SSL. After starting the server, open a browser and navigate to https://app.enfugue.ai:45554. If that doesn't work due to your networking configuration, you can instead access the server at http://127.0.0.1:45555 or http://localhost:45555. Some features are only available in a secure environment and will be disabled when using the insecure server, review the troubleshooting and configuration guides to figure out why it may not be working.

Quickstart Guide

Please read the newly-written New User Quick-Start Guide for basic usage and controls.

Authentication

When enabled, authentication will be required when using Enfugue. This enables system administrators to create a two-tiered hierarchy of users and administrators, where users are not permitted to modify models or the installation itself; they are only allowed to use the pre-configured setup. The primary impetus behind this was to create the ability for parents to curate an environment for children to safely experiment with generative AI.

<p align="center"> <img src="https://github.com/painebenjamin/app.enfugue.ai/assets/57536852/c1603304-ad73-48a3-91c9-aecbffbe4841" alt="A window in the ENFUGUE interface offering multiple settings options" /> </p>

Once enabled in the settings menu, you will be taken to a login screen. The default user and password are both enfugue, all lowercase. You can change any other user's password as an administrator.

If you ever forget your password, you can reset the root password by creating a file named password_reset.txt in the enfugue cache directory with the desired new password, then restart the server. The cache directory is located at ~/.cache/enfugue/, where ~ is your home directory or user directory, depending on platform.

Tips

Here are a few quick tips to getting great results:

  1. The base Stable Diffusion model can create some pretty good images, but it's with the fine-tuned models from the larger AI community that you will see the best images. Open up the CivitAI browser and download the latest and greatest models to give them a try.
  2. The very first invocation with a new model will always take quite a bit longer than subsequent ones, as Enfugue moves files and downloads any other necessary files.
  3. Upscaling can take an image from mediocre to great with surprising frequency. Try out the AI upscale methods and upscale diffusion to take your image generation to the next level.

Troubleshooting

Here are a few steps to take if you're having trouble getting Enfugue to work for you:

  1. Ensure your Firewall is not blocking port inbound ports 45554 and 45555. This would be uncommon, but possible in strict environments. See here for details on how to create an Inbound Port rule.
  2. Instead of typing in my.enfugue.ai, go directly to https://app.enfugue.ai:45554/
  3. Instead of trying to use the secure server, use the insecure one by doing to http://127.0.0.1:45555/.
  4. Clear you cache and cookies, then try reload the app.
  5. Report your issue in the issues tab

If all else fails, you can always try deleting the enfugue folder and enfugue.db file in your ~/.cache directory to re-initialize the application.

FAQ

What is "Full FP32", "Pruned PickleTensor", etc.?

These flags are the precision level and format of the model. In order to use all of Enfugue's features, Enfugue will change these formats and precisions as necessary, so in theory any of them will work the same as the other. In practice, if one is available, pick Pruned and FP16/Half for the fastest download and processes.

What are the best settings for the best images?

There is still much to be learned about generative AI in general, and Stable Diffusion in specific. A great starting point has been preconfigured in Enfugue, but there will be no one-size-fits-all set of parameters that works for every kind of image you want to generate. The best way to learn is simply to play with the values and see what the effect is on the final image.

Where can I learn more?

  1. The Wiki (in progress)
  2. The Discussion Boards

Additional resources will be made available as they are needed, so don't hesitate to ask for what you think will work best for you.

For Developers

The Enfugue Diffusion Pipeline

Enfugue uses an extension of diffusers.StableDiffusionPipeline that provides a number of additional arguments over the typical signature, weaving between txt2img, img2img, inpaint and controlnet as necessary. It also has TensorRT support for all models in the pipeline. Start here for documentation on how it is used.

Enfugue JSON API

The entirety of Enfugue's capabilities are available via JSON API. Find the documentation in the wiki.

Building

For anyone interested in building from source themselves, simply check out this repository and issue a make command to build the associated binary release. See below for all make targets.

Build StepDescriptionDepends On
cleanThis target removes build artifacts.None
typecheckThis step runs mypy against each source file. See mypy-lang.org for details on python static typing. Mypy is ran with the --strict flag, meaning all constraints are opted in.Python source files
importcheckThis step runs importcheck against each source file. See github for details on importcheck; simply put, it will produce an error if an imported module is not used.Python source files
unittestThis step runs doctest against each source file. See the Python Documentation for details on doctest. This will run all tests placed in docstrings, you will see these as python commands in the documentation, prepended by >>>Python source files
testThis step runs enfugue.test.run. This will run the main method in <n>*.py files places in the test directory.Python source files, python test files
vendorThis step fetches vendor resources by running all scripts under the vendor/ directory.Script files
jsThis step compresses and mangles the .mjs files using terser.src/js/*.mjs files
cssThis step minifies all css files using cssminify.src/css/*.css files
html, imgThese step simply copy the relevant static directories (/html, /img) to the build directory.src/html/*.html files, src/img/*.* files
sdistThis step compiles the source distribution into an installable .tar.gz file, suitable for passing to pip install. Contains all the results of the previous stepsPython source files, passing typecheck, importcheck, unittest, and test, running vendor, compiling js, css, html, and img
distThis step compiles the relevant executable artifact (and zips/tars it).sdist
dockerfileThis step compiles the dockerfile and prepares it for building.sdist
dockerThis step builds the docker image.dockerfile

Running directly from Source

To run directly from source (in development mode,) use the scripts/run-dev.sh script. This works on Windows (in Cygwin) and on Linux, it has not been tested on MacOS.