stable-diffusion-webui/frontend
xaedes 33b896d0cb
Scene-to-Image Prompt Layering System (#1179)
# Summary of the change

- new Scene-to-Image tab
- new scn2img function
- functions for loading and running monocular_depth_estimation with
tensorflow

# Description

(relevant motivation, which issue is fixed)

Related to discussion #925

> Would it be possible to have a layers system where we could do have
foreground, mid, and background objects which relate to one another and
share the style? So we could say generate a landscape, one another layer
generate a castle, and on another layer generate a crowd of people.

To make this work I made a prompt-based layering system in a new
"Scene-to-Image" tab.
You write a a multi-line prompt that looks like markdown, where each
section declares one layer.
It is hierarchical, so each layer can have their own child layers.

Examples: https://imgur.com/a/eUxd5qn
![](https://i.imgur.com/L61w00Q.png)

In the frontend you can find a brief documentation for the syntax,
examples and reference for the various arguments.

Here a short summary:

Sections with "prompt" and child layers are img2img, without child
layers they are txt2img.
Without "prompt" they are just images, useful for mask selection, image
composition, etc.
Images can be initialized with "color", resized with "resize" and their
position specified with "pos".
Rotation and rotation center are "rotation" and "center". 

Mask can automatically be selected by color or by estimated depth based
on https://huggingface.co/spaces/atsantiago/Monocular_Depth_Filter.

![](https://i.imgur.com/8rMHWmZ.png)

# Additional dependencies that are required for this change

For mask selection by monocular depth estimation tensorflow is required
and the model must be cloned to ./src/monocular_depth_estimation/
Changes in environment.yaml:
- einops>=0.3.0
- tensorflow>=2.10.0 

Einops must be allowed to be newer for tensorflow to work.

# Checklist:

- [x] I have changed the base branch to `dev`
- [x] I have performed a self-review of my own code
- [x] I have commented my code in hard-to-understand areas
- [x] I have made corresponding changes to the documentation

Co-authored-by: hlky <106811348+hlky@users.noreply.github.com>
2022-10-02 18:23:37 +01:00
..
css gallery_v1 2022-10-01 20:14:32 +02:00
dists gallery_v1 2022-10-01 20:14:32 +02:00
js fix: gradio js (#1375) 2022-10-01 23:39:56 +03:00
src Added implementation of the Concepts Library tab made by @Qualzz. 2022-09-20 21:06:00 -07:00
__init__.py Refactored the UI, added a web_playground.py to be run without any models. 2022-08-29 00:41:17 +01:00
.eslintrc.js Fixed missing frontend/dist folder. 2022-09-20 21:45:16 -07:00
css_and_js.py License header 2022-09-26 14:02:48 +01:00
frontend.py Scene-to-Image Prompt Layering System (#1179) 2022-10-02 18:23:37 +01:00
image_metadata.py License header 2022-09-26 14:02:48 +01:00
index.html Added implementation of the Concepts Library tab made by @Qualzz. 2022-09-20 21:06:00 -07:00
job_manager.py License header 2022-09-26 14:02:48 +01:00
package.json Added implementation of the Concepts Library tab made by @Qualzz. 2022-09-20 21:06:00 -07:00
tsconfig.json Added implementation of the Concepts Library tab made by @Qualzz. 2022-09-20 21:06:00 -07:00
tsconfig.node.json Added implementation of the Concepts Library tab made by @Qualzz. 2022-09-20 21:06:00 -07:00
ui_functions.py License header 2022-09-26 14:02:48 +01:00
vite.config.ts Added implementation of the Concepts Library tab made by @Qualzz. 2022-09-20 21:06:00 -07:00