Giter Site home page Giter Site logo

prompt-fusion-extension's Introduction

Prompt Fusion

Prompt Fusion is an auto1111 webui extension that adds more possibilities to the native prompt syntax. Among other additions, it allows to interpolate between the embeddings of different prompts, continuously:

# linear prompt interpolation
[night light:magical forest: 5, 15]

# catmull-rom curve prompt interpolation
[night light:magical forest:norvegian territory: 5, 15, 25:catmull]

# linear attention interpolation
(fire extinguisher: 1.0, 2.0)

# prompt-editing-aware attention interpolation
[(fire extinguisher: 1.0, 2.0)::5]

# define functions and variables to simplify repeating patterns and use a consistent structure
$prompt($style, $quality, $character, $background) = (
    A detailed picture in the style of $style,
    $quality,
    $character lying back,
    $background in the background
:1)

The prompt interpolation feature is similar to Prompt Travel, which allows to create videos of images generated by navigating the latent space iteratively. Unlike Prompt Travel however, instead of generating multiple images, Prompt Fusion allows you to travel during the sampling process of a single image. Also, instead of interpolating the latent space, it uses the embedding space to determine intermediate embeddings.

Prompt interpolation is also similar to Prompt Blending. The main difference is that this extension calculates a new embedding for every step, as opposed to calculating it once and using that same one embedding for all the steps.

The attention interpolation feature is similar to Shift Attention, which allows to generate multiple images with slight variations in the attention given to certain parts of the prompt. Unlike Shift Attention, instead of generating multiple images, Prompt Fusion allows to shift the attention of certain parts of a prompt during the sampling process of a single image.

Examples

1. Influencing the beginning of the sampling process

Interpolate linearly (by default) from lion (step 0) to bird (step 8) to girl (step 11), and stay at girl for the rest of the sampling steps:

[lion:bird:girl: , 7, 10]

curve1

2. Influencing the middle of the sampling process

Interpolate using a bezier curve from fireball monster (step 0) to dragon monster (step 12, because 30 steps * 0.4 = step 12), while using seawater monster as an intermediate control point to steer the curve away during interpolation and to get creative results:

[fireball:seawater:dragon: , .1, .4:bezier] monster

curve2

Features

Webui supported releases

The following webui releases are officially supported:

  • v1.0.0-pre

Installation

  1. Visit the Extensions tab of Automatic's WebUI.
  2. Visit the Install from URL subtab.
  3. Copy and paste https://github.com/ljleb/prompt-fusion-extension in the URL for extension's git repository textbox.
  4. Press the Install button.

Usage

  • Check the wiki pages for the extension documentation.

Related Projects

prompt-fusion-extension's People

Contributors

ljleb avatar pladselsker avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.