+
404
+
+
Page not found :(
+
The requested page could not be found.
+
diff --git a/docs/Gemfile b/docs/Gemfile
new file mode 100644
index 0000000..5e9958b
--- /dev/null
+++ b/docs/Gemfile
@@ -0,0 +1,33 @@
+source "https://rubygems.org"
+# Hello! This is where you manage which Jekyll version is used to run.
+# When you want to use a different version, change it below, save the
+# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
+#
+# bundle exec jekyll serve
+#
+# This will help ensure the proper Jekyll version is running.
+# Happy Jekylling!
+gem "jekyll", "~> 3.9.3"
+# This is the default theme for new Jekyll sites. You may change this to anything you like.
+gem "minima", "~> 2.5.1"
+# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
+# uncomment the line below. To upgrade, run `bundle update github-pages`.
+gem "github-pages", "~> 228", group: :jekyll_plugins
+
+group :jekyll_plugins do
+ gem "webrick"
+end
+
+# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
+# and associated library.
+platforms :mingw, :x64_mingw, :mswin, :jruby do
+ gem "tzinfo", ">= 1", "< 3"
+ gem "tzinfo-data"
+end
+
+# Performance-booster for watching directories on Windows
+gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]
+
+# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
+# do not have a Java counterpart.
+gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]
diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock
new file mode 100644
index 0000000..a8dff05
--- /dev/null
+++ b/docs/Gemfile.lock
@@ -0,0 +1,266 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ activesupport (7.0.6)
+ concurrent-ruby (~> 1.0, >= 1.0.2)
+ i18n (>= 1.6, < 2)
+ minitest (>= 5.1)
+ tzinfo (~> 2.0)
+ addressable (2.8.4)
+ public_suffix (>= 2.0.2, < 6.0)
+ coffee-script (2.4.1)
+ coffee-script-source
+ execjs
+ coffee-script-source (1.11.1)
+ colorator (1.1.0)
+ commonmarker (0.23.9)
+ concurrent-ruby (1.2.2)
+ dnsruby (1.70.0)
+ simpleidn (~> 0.2.1)
+ em-websocket (0.5.3)
+ eventmachine (>= 0.12.9)
+ http_parser.rb (~> 0)
+ ethon (0.16.0)
+ ffi (>= 1.15.0)
+ eventmachine (1.2.7)
+ execjs (2.8.1)
+ faraday (2.7.10)
+ faraday-net_http (>= 2.0, < 3.1)
+ ruby2_keywords (>= 0.0.4)
+ faraday-net_http (3.0.2)
+ ffi (1.15.5)
+ forwardable-extended (2.6.0)
+ gemoji (3.0.1)
+ github-pages (228)
+ github-pages-health-check (= 1.17.9)
+ jekyll (= 3.9.3)
+ jekyll-avatar (= 0.7.0)
+ jekyll-coffeescript (= 1.1.1)
+ jekyll-commonmark-ghpages (= 0.4.0)
+ jekyll-default-layout (= 0.1.4)
+ jekyll-feed (= 0.15.1)
+ jekyll-gist (= 1.5.0)
+ jekyll-github-metadata (= 2.13.0)
+ jekyll-include-cache (= 0.2.1)
+ jekyll-mentions (= 1.6.0)
+ jekyll-optional-front-matter (= 0.3.2)
+ jekyll-paginate (= 1.1.0)
+ jekyll-readme-index (= 0.3.0)
+ jekyll-redirect-from (= 0.16.0)
+ jekyll-relative-links (= 0.6.1)
+ jekyll-remote-theme (= 0.4.3)
+ jekyll-sass-converter (= 1.5.2)
+ jekyll-seo-tag (= 2.8.0)
+ jekyll-sitemap (= 1.4.0)
+ jekyll-swiss (= 1.0.0)
+ jekyll-theme-architect (= 0.2.0)
+ jekyll-theme-cayman (= 0.2.0)
+ jekyll-theme-dinky (= 0.2.0)
+ jekyll-theme-hacker (= 0.2.0)
+ jekyll-theme-leap-day (= 0.2.0)
+ jekyll-theme-merlot (= 0.2.0)
+ jekyll-theme-midnight (= 0.2.0)
+ jekyll-theme-minimal (= 0.2.0)
+ jekyll-theme-modernist (= 0.2.0)
+ jekyll-theme-primer (= 0.6.0)
+ jekyll-theme-slate (= 0.2.0)
+ jekyll-theme-tactile (= 0.2.0)
+ jekyll-theme-time-machine (= 0.2.0)
+ jekyll-titles-from-headings (= 0.5.3)
+ jemoji (= 0.12.0)
+ kramdown (= 2.3.2)
+ kramdown-parser-gfm (= 1.1.0)
+ liquid (= 4.0.4)
+ mercenary (~> 0.3)
+ minima (= 2.5.1)
+ nokogiri (>= 1.13.6, < 2.0)
+ rouge (= 3.26.0)
+ terminal-table (~> 1.4)
+ github-pages-health-check (1.17.9)
+ addressable (~> 2.3)
+ dnsruby (~> 1.60)
+ octokit (~> 4.0)
+ public_suffix (>= 3.0, < 5.0)
+ typhoeus (~> 1.3)
+ html-pipeline (2.14.3)
+ activesupport (>= 2)
+ nokogiri (>= 1.4)
+ http_parser.rb (0.8.0)
+ i18n (1.14.1)
+ concurrent-ruby (~> 1.0)
+ jekyll (3.9.3)
+ addressable (~> 2.4)
+ colorator (~> 1.0)
+ em-websocket (~> 0.5)
+ i18n (>= 0.7, < 2)
+ jekyll-sass-converter (~> 1.0)
+ jekyll-watch (~> 2.0)
+ kramdown (>= 1.17, < 3)
+ liquid (~> 4.0)
+ mercenary (~> 0.3.3)
+ pathutil (~> 0.9)
+ rouge (>= 1.7, < 4)
+ safe_yaml (~> 1.0)
+ jekyll-avatar (0.7.0)
+ jekyll (>= 3.0, < 5.0)
+ jekyll-coffeescript (1.1.1)
+ coffee-script (~> 2.2)
+ coffee-script-source (~> 1.11.1)
+ jekyll-commonmark (1.4.0)
+ commonmarker (~> 0.22)
+ jekyll-commonmark-ghpages (0.4.0)
+ commonmarker (~> 0.23.7)
+ jekyll (~> 3.9.0)
+ jekyll-commonmark (~> 1.4.0)
+ rouge (>= 2.0, < 5.0)
+ jekyll-default-layout (0.1.4)
+ jekyll (~> 3.0)
+ jekyll-feed (0.15.1)
+ jekyll (>= 3.7, < 5.0)
+ jekyll-gist (1.5.0)
+ octokit (~> 4.2)
+ jekyll-github-metadata (2.13.0)
+ jekyll (>= 3.4, < 5.0)
+ octokit (~> 4.0, != 4.4.0)
+ jekyll-include-cache (0.2.1)
+ jekyll (>= 3.7, < 5.0)
+ jekyll-mentions (1.6.0)
+ html-pipeline (~> 2.3)
+ jekyll (>= 3.7, < 5.0)
+ jekyll-optional-front-matter (0.3.2)
+ jekyll (>= 3.0, < 5.0)
+ jekyll-paginate (1.1.0)
+ jekyll-readme-index (0.3.0)
+ jekyll (>= 3.0, < 5.0)
+ jekyll-redirect-from (0.16.0)
+ jekyll (>= 3.3, < 5.0)
+ jekyll-relative-links (0.6.1)
+ jekyll (>= 3.3, < 5.0)
+ jekyll-remote-theme (0.4.3)
+ addressable (~> 2.0)
+ jekyll (>= 3.5, < 5.0)
+ jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0)
+ rubyzip (>= 1.3.0, < 3.0)
+ jekyll-sass-converter (1.5.2)
+ sass (~> 3.4)
+ jekyll-seo-tag (2.8.0)
+ jekyll (>= 3.8, < 5.0)
+ jekyll-sitemap (1.4.0)
+ jekyll (>= 3.7, < 5.0)
+ jekyll-swiss (1.0.0)
+ jekyll-theme-architect (0.2.0)
+ jekyll (> 3.5, < 5.0)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-cayman (0.2.0)
+ jekyll (> 3.5, < 5.0)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-dinky (0.2.0)
+ jekyll (> 3.5, < 5.0)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-hacker (0.2.0)
+ jekyll (> 3.5, < 5.0)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-leap-day (0.2.0)
+ jekyll (> 3.5, < 5.0)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-merlot (0.2.0)
+ jekyll (> 3.5, < 5.0)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-midnight (0.2.0)
+ jekyll (> 3.5, < 5.0)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-minimal (0.2.0)
+ jekyll (> 3.5, < 5.0)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-modernist (0.2.0)
+ jekyll (> 3.5, < 5.0)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-primer (0.6.0)
+ jekyll (> 3.5, < 5.0)
+ jekyll-github-metadata (~> 2.9)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-slate (0.2.0)
+ jekyll (> 3.5, < 5.0)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-tactile (0.2.0)
+ jekyll (> 3.5, < 5.0)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-time-machine (0.2.0)
+ jekyll (> 3.5, < 5.0)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-titles-from-headings (0.5.3)
+ jekyll (>= 3.3, < 5.0)
+ jekyll-watch (2.2.1)
+ listen (~> 3.0)
+ jemoji (0.12.0)
+ gemoji (~> 3.0)
+ html-pipeline (~> 2.2)
+ jekyll (>= 3.0, < 5.0)
+ kramdown (2.3.2)
+ rexml
+ kramdown-parser-gfm (1.1.0)
+ kramdown (~> 2.0)
+ liquid (4.0.4)
+ listen (3.8.0)
+ rb-fsevent (~> 0.10, >= 0.10.3)
+ rb-inotify (~> 0.9, >= 0.9.10)
+ mercenary (0.3.6)
+ minima (2.5.1)
+ jekyll (>= 3.5, < 5.0)
+ jekyll-feed (~> 0.9)
+ jekyll-seo-tag (~> 2.1)
+ minitest (5.18.1)
+ nokogiri (1.15.3-x86_64-linux)
+ racc (~> 1.4)
+ octokit (4.25.1)
+ faraday (>= 1, < 3)
+ sawyer (~> 0.9)
+ pathutil (0.16.2)
+ forwardable-extended (~> 2.6)
+ public_suffix (4.0.7)
+ racc (1.7.1)
+ rb-fsevent (0.11.2)
+ rb-inotify (0.10.1)
+ ffi (~> 1.0)
+ rexml (3.2.5)
+ rouge (3.26.0)
+ ruby2_keywords (0.0.5)
+ rubyzip (2.3.2)
+ safe_yaml (1.0.5)
+ sass (3.7.4)
+ sass-listen (~> 4.0.0)
+ sass-listen (4.0.0)
+ rb-fsevent (~> 0.9, >= 0.9.4)
+ rb-inotify (~> 0.9, >= 0.9.7)
+ sawyer (0.9.2)
+ addressable (>= 2.3.5)
+ faraday (>= 0.17.3, < 3)
+ simpleidn (0.2.1)
+ unf (~> 0.1.4)
+ terminal-table (1.8.0)
+ unicode-display_width (~> 1.1, >= 1.1.1)
+ typhoeus (1.4.0)
+ ethon (>= 0.9.0)
+ tzinfo (2.0.6)
+ concurrent-ruby (~> 1.0)
+ unf (0.1.4)
+ unf_ext
+ unf_ext (0.0.8.2)
+ unicode-display_width (1.8.0)
+ webrick (1.8.1)
+
+PLATFORMS
+ x86_64-linux
+
+DEPENDENCIES
+ github-pages (~> 228)
+ http_parser.rb (~> 0.6.0)
+ jekyll (~> 3.9.3)
+ minima (~> 2.5.1)
+ tzinfo (>= 1, < 3)
+ tzinfo-data
+ wdm (~> 0.1.1)
+ webrick
+
+BUNDLED WITH
+ 2.4.17
diff --git a/docs/_config.yml b/docs/_config.yml
new file mode 100644
index 0000000..c93012a
--- /dev/null
+++ b/docs/_config.yml
@@ -0,0 +1,58 @@
+# Welcome to Jekyll!
+#
+# This config file is meant for settings that affect your whole blog, values
+# which you are expected to set up once and rarely edit after that. If you find
+# yourself editing this file very often, consider using Jekyll's data files
+# feature for the data you need to update frequently.
+#
+# For technical reasons, this file is *NOT* reloaded automatically when you use
+# 'bundle exec jekyll serve'. If you change this file, please restart the server process.
+#
+# If you need help with YAML syntax, here are some quick references for you:
+# https://learn-the-web.algonquindesign.ca/topics/markdown-yaml-cheat-sheet/#yaml
+# https://learnxinyminutes.com/docs/yaml/
+#
+# Site settings
+# These are used to personalize your new site. If you look in the HTML files,
+# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on.
+# You can create any custom variable you would like, and they will be accessible
+# in the templates via {{ site.myvariable }}.
+
+title: FaceSwap Lab
+description: >- # this means to ignore newlines until "baseurl:"
+ FaceSwapLab is an extension for Stable Diffusion that simplifies face-swapping.
+ Some key functions of FaceSwapLab include the ability to reuse faces via checkpoints,
+ batch process images, sort faces based on size or gender, and support for vladmantic.
+domain: glucauze.github.io
+url: https://glucauze.github.io
+baseurl: /sd-webui-faceswaplab/
+
+# Build settings
+theme: minima
+
+author:
+ name: Glucauze
+ email: ""
+
+minima:
+ skin: dark
+
+# Exclude from processing.
+# The following items will not be processed, by default.
+# Any item listed under the `exclude:` key here will be automatically added to
+# the internal "default list".
+#
+# Excluded items can be processed by explicitly listing the directories or
+# their entries' file path in the `include:` list.
+#
+# exclude:
+# - .sass-cache/
+# - .jekyll-cache/
+# - gemfiles/
+# - Gemfile
+# - Gemfile.lock
+# - node_modules/
+# - vendor/bundle/
+# - vendor/cache/
+# - vendor/gems/
+# - vendor/ruby/
diff --git a/docs/_includes/footer.html b/docs/_includes/footer.html
new file mode 100644
index 0000000..e69de29
diff --git a/docs/_sass/minima.scss b/docs/_sass/minima.scss
new file mode 100644
index 0000000..7cb111f
--- /dev/null
+++ b/docs/_sass/minima.scss
@@ -0,0 +1,59 @@
+@charset "utf-8";
+
+// Define defaults for each variable.
+
+$base-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !default;
+$base-font-size: 16px !default;
+$base-font-weight: 400 !default;
+$small-font-size: $base-font-size * 0.875 !default;
+$base-line-height: 1.5 !default;
+
+$spacing-unit: 30px !default;
+
+$text-color: #e7f6f2!default;
+$background-color: #2c3333 !default;
+$brand-color: #FF8C6A !default;
+
+$grey-color: lighten($brand-color, 30%) !default;
+$grey-color-light: lighten($grey-color, 40%) !default;
+$grey-color-dark: darken($grey-color, 25%) !default;
+
+$table-text-align: left !default;
+
+// Width of the content area
+$content-width: 800px !default;
+
+$on-palm: 600px !default;
+$on-laptop: 800px !default;
+
+// Use media queries like this:
+// @include media-query($on-palm) {
+// .wrapper {
+// padding-right: $spacing-unit / 2;
+// padding-left: $spacing-unit / 2;
+// }
+// }
+@mixin media-query($device) {
+ @media screen and (max-width: $device) {
+ @content;
+ }
+}
+
+@mixin relative-font-size($ratio) {
+ font-size: $base-font-size * $ratio;
+}
+
+// Import partials.
+@import
+ "minima/base",
+ "minima/layout",
+ "minima/syntax-highlighting"
+;
+
+
+img{
+ display: block;
+ margin : 1em;
+ margin-left:auto;
+ margin-right:auto;
+}
\ No newline at end of file
diff --git a/docs/_sass/minima/_base.scss b/docs/_sass/minima/_base.scss
new file mode 100644
index 0000000..d88c445
--- /dev/null
+++ b/docs/_sass/minima/_base.scss
@@ -0,0 +1,247 @@
+/**
+ * Reset some basic elements
+ */
+body, h1, h2, h3, h4, h5, h6,
+p, blockquote, pre, hr,
+dl, dd, ol, ul, figure {
+ margin: 0;
+ padding: 0;
+}
+
+
+
+/**
+ * Basic styling
+ */
+body {
+ font: $base-font-weight #{$base-font-size}/#{$base-line-height} $base-font-family;
+ color: $text-color;
+ background-color: $background-color;
+ -webkit-text-size-adjust: 100%;
+ -webkit-font-feature-settings: "kern" 1;
+ -moz-font-feature-settings: "kern" 1;
+ -o-font-feature-settings: "kern" 1;
+ font-feature-settings: "kern" 1;
+ font-kerning: normal;
+ display: flex;
+ min-height: 100vh;
+ flex-direction: column;
+}
+
+
+
+/**
+ * Set `margin-bottom` to maintain vertical rhythm
+ */
+h1, h2, h3, h4, h5, h6,
+p, blockquote, pre,
+ul, ol, dl, figure,
+%vertical-rhythm {
+ margin-bottom: $spacing-unit / 2;
+}
+
+
+
+/**
+ * `main` element
+ */
+main {
+ display: block; /* Default value of `display` of `main` element is 'inline' in IE 11. */
+}
+
+
+
+/**
+ * Images
+ */
+img {
+ max-width: 100%;
+ vertical-align: middle;
+}
+
+
+
+/**
+ * Figures
+ */
+figure > img {
+ display: block;
+}
+
+figcaption {
+ font-size: $small-font-size;
+}
+
+
+
+/**
+ * Lists
+ */
+ul, ol {
+ margin-left: $spacing-unit;
+}
+
+li {
+ > ul,
+ > ol {
+ margin-bottom: 0;
+ }
+}
+
+
+
+/**
+ * Headings
+ */
+h1, h2, h3, h4, h5, h6 {
+ font-weight: $base-font-weight;
+}
+
+
+
+/**
+ * Links
+ */
+a {
+ color: $brand-color;
+ text-decoration: none;
+
+ &:visited {
+ color: darken($brand-color, 15%);
+ }
+
+ &:hover {
+ color: $text-color;
+ text-decoration: underline;
+ }
+
+ .social-media-list &:hover {
+ text-decoration: none;
+
+ .username {
+ text-decoration: underline;
+ }
+ }
+}
+
+
+/**
+ * Blockquotes
+ */
+blockquote {
+ color: $grey-color;
+ border-left: 4px solid $grey-color-light;
+ padding-left: $spacing-unit / 2;
+ @include relative-font-size(1.125);
+ letter-spacing: -1px;
+ font-style: italic;
+
+ > :last-child {
+ margin-bottom: 0;
+ }
+}
+
+
+
+/**
+ * Code formatting
+ */
+pre,
+code {
+ @include relative-font-size(0.9375);
+ border: 1px solid $grey-color-light;
+ border-radius: 3px;
+}
+
+code {
+ padding: 1px 5px;
+}
+
+pre {
+ padding: 8px 12px;
+ overflow-x: auto;
+
+ > code {
+ border: 0;
+ padding-right: 0;
+ padding-left: 0;
+ }
+}
+
+
+
+/**
+ * Wrapper
+ */
+.wrapper {
+ max-width: -webkit-calc(#{$content-width} - (#{$spacing-unit} * 2));
+ max-width: calc(#{$content-width} - (#{$spacing-unit} * 2));
+ margin-right: auto;
+ margin-left: auto;
+ padding-right: $spacing-unit;
+ padding-left: $spacing-unit;
+ @extend %clearfix;
+
+ @include media-query($on-laptop) {
+ max-width: -webkit-calc(#{$content-width} - (#{$spacing-unit}));
+ max-width: calc(#{$content-width} - (#{$spacing-unit}));
+ padding-right: $spacing-unit / 2;
+ padding-left: $spacing-unit / 2;
+ }
+}
+
+
+
+/**
+ * Clearfix
+ */
+%clearfix:after {
+ content: "";
+ display: table;
+ clear: both;
+}
+
+
+
+/**
+ * Icons
+ */
+
+.svg-icon {
+ width: 16px;
+ height: 16px;
+ display: inline-block;
+ fill: #{$grey-color};
+ padding-right: 5px;
+ vertical-align: text-top;
+}
+
+.social-media-list {
+ li + li {
+ padding-top: 5px;
+ }
+}
+
+
+
+/**
+ * Tables
+ */
+table {
+ margin-bottom: $spacing-unit;
+ width: 100%;
+ text-align: $table-text-align;
+ color: lighten($text-color, 18%);
+ border-collapse: collapse;
+ border: 1px solid $grey-color-light;
+ th, td {
+ padding: ($spacing-unit / 3) ($spacing-unit / 2);
+ }
+ th {
+ border: 1px solid darken($grey-color-light, 4%);
+ border-bottom-color: darken($grey-color-light, 12%);
+ }
+ td {
+ border: 1px solid $grey-color-light;
+ }
+}
diff --git a/docs/_sass/minima/_layout.scss b/docs/_sass/minima/_layout.scss
new file mode 100644
index 0000000..c69af11
--- /dev/null
+++ b/docs/_sass/minima/_layout.scss
@@ -0,0 +1,255 @@
+/**
+ * Site header
+ */
+.site-header {
+ border-top: 5px solid $grey-color-dark;
+ border-bottom: 1px solid $grey-color-light;
+ min-height: $spacing-unit * 1.865;
+
+ // Positioning context for the mobile navigation icon
+ position: relative;
+}
+
+.site-title {
+ @include relative-font-size(1.625);
+ font-weight: 300;
+ line-height: $base-line-height * $base-font-size * 2.25;
+ letter-spacing: -1px;
+ margin-bottom: 0;
+ float: left;
+
+ &,
+ &:visited {
+ color: $grey-color-dark;
+ }
+}
+
+.site-nav {
+ float: right;
+ line-height: $base-line-height * $base-font-size * 2.25;
+
+ .nav-trigger {
+ display: none;
+ }
+
+ .menu-icon {
+ display: none;
+ }
+
+ .page-link {
+ color: $text-color;
+ line-height: $base-line-height;
+
+ // Gaps between nav items, but not on the last one
+ &:not(:last-child) {
+ margin-right: 20px;
+ }
+ }
+
+ @include media-query($on-palm) {
+ position: absolute;
+ top: 9px;
+ right: $spacing-unit / 2;
+ background-color: $background-color;
+ border: 1px solid $grey-color-light;
+ border-radius: 5px;
+ text-align: right;
+
+ label[for="nav-trigger"] {
+ display: block;
+ float: right;
+ width: 36px;
+ height: 36px;
+ z-index: 2;
+ cursor: pointer;
+ }
+
+ .menu-icon {
+ display: block;
+ float: right;
+ width: 36px;
+ height: 26px;
+ line-height: 0;
+ padding-top: 10px;
+ text-align: center;
+
+ > svg {
+ fill: $grey-color-dark;
+ }
+ }
+
+ input ~ .trigger {
+ clear: both;
+ display: none;
+ }
+
+ input:checked ~ .trigger {
+ display: block;
+ padding-bottom: 5px;
+ }
+
+ .page-link {
+ display: block;
+ padding: 5px 10px;
+
+ &:not(:last-child) {
+ margin-right: 0;
+ }
+ margin-left: 20px;
+ }
+ }
+}
+
+
+
+/**
+ * Site footer
+ */
+.site-footer {
+ border-top: 1px solid $grey-color-light;
+ padding: $spacing-unit 0;
+}
+
+.footer-heading {
+ @include relative-font-size(1.125);
+ margin-bottom: $spacing-unit / 2;
+}
+
+.contact-list,
+.social-media-list {
+ list-style: none;
+ margin-left: 0;
+}
+
+.footer-col-wrapper {
+ @include relative-font-size(0.9375);
+ color: $grey-color;
+ margin-left: -$spacing-unit / 2;
+ @extend %clearfix;
+}
+
+.footer-col {
+ float: left;
+ margin-bottom: $spacing-unit / 2;
+ padding-left: $spacing-unit / 2;
+}
+
+.footer-col-1 {
+ width: -webkit-calc(35% - (#{$spacing-unit} / 2));
+ width: calc(35% - (#{$spacing-unit} / 2));
+}
+
+.footer-col-2 {
+ width: -webkit-calc(20% - (#{$spacing-unit} / 2));
+ width: calc(20% - (#{$spacing-unit} / 2));
+}
+
+.footer-col-3 {
+ width: -webkit-calc(45% - (#{$spacing-unit} / 2));
+ width: calc(45% - (#{$spacing-unit} / 2));
+}
+
+@include media-query($on-laptop) {
+ .footer-col-1,
+ .footer-col-2 {
+ width: -webkit-calc(50% - (#{$spacing-unit} / 2));
+ width: calc(50% - (#{$spacing-unit} / 2));
+ }
+
+ .footer-col-3 {
+ width: -webkit-calc(100% - (#{$spacing-unit} / 2));
+ width: calc(100% - (#{$spacing-unit} / 2));
+ }
+}
+
+@include media-query($on-palm) {
+ .footer-col {
+ float: none;
+ width: -webkit-calc(100% - (#{$spacing-unit} / 2));
+ width: calc(100% - (#{$spacing-unit} / 2));
+ }
+}
+
+
+
+/**
+ * Page content
+ */
+.page-content {
+ padding: $spacing-unit 0;
+ flex: 1;
+}
+
+.page-heading {
+ @include relative-font-size(2);
+}
+
+.post-list-heading {
+ @include relative-font-size(1.75);
+}
+
+.post-list {
+ margin-left: 0;
+ list-style: none;
+
+ > li {
+ margin-bottom: $spacing-unit;
+ }
+}
+
+.post-meta {
+ font-size: $small-font-size;
+ color: $grey-color;
+}
+
+.post-link {
+ display: block;
+ @include relative-font-size(1.5);
+}
+
+
+
+/**
+ * Posts
+ */
+.post-header {
+ margin-bottom: $spacing-unit;
+}
+
+.post-title {
+ @include relative-font-size(2.625);
+ letter-spacing: -1px;
+ line-height: 1;
+
+ @include media-query($on-laptop) {
+ @include relative-font-size(2.25);
+ }
+}
+
+.post-content {
+ margin-bottom: $spacing-unit;
+
+ h2 {
+ @include relative-font-size(2);
+
+ @include media-query($on-laptop) {
+ @include relative-font-size(1.75);
+ }
+ }
+
+ h3 {
+ @include relative-font-size(1.625);
+
+ @include media-query($on-laptop) {
+ @include relative-font-size(1.375);
+ }
+ }
+
+ h4 {
+ @include relative-font-size(1.25);
+
+ @include media-query($on-laptop) {
+ @include relative-font-size(1.125);
+ }
+ }
+}
diff --git a/docs/_sass/minima/_syntax-highlighting.scss b/docs/_sass/minima/_syntax-highlighting.scss
new file mode 100644
index 0000000..a80f53d
--- /dev/null
+++ b/docs/_sass/minima/_syntax-highlighting.scss
@@ -0,0 +1,71 @@
+/**
+ * Syntax highlighting styles
+ */
+.highlight {
+ background: #fff;
+ @extend %vertical-rhythm;
+
+ .highlighter-rouge & {
+ background: black;
+ }
+
+ .c { color: #998; font-style: italic } // Comment
+ .err { color: #a61717; background-color: #e3d2d2 } // Error
+ .k { font-weight: bold } // Keyword
+ .o { font-weight: bold } // Operator
+ .cm { color: #998; font-style: italic } // Comment.Multiline
+ .cp { color: #999; font-weight: bold } // Comment.Preproc
+ .c1 { color: #998; font-style: italic } // Comment.Single
+ .cs { color: #999; font-weight: bold; font-style: italic } // Comment.Special
+ .gd { color: #000; background-color: #fdd } // Generic.Deleted
+ .gd .x { color: #000; background-color: #faa } // Generic.Deleted.Specific
+ .ge { font-style: italic } // Generic.Emph
+ .gr { color: #a00 } // Generic.Error
+ .gh { color: #999 } // Generic.Heading
+ .gi { color: #000; background-color: #dfd } // Generic.Inserted
+ .gi .x { color: #000; background-color: #afa } // Generic.Inserted.Specific
+ .go { color: #888 } // Generic.Output
+ .gp { color: #555 } // Generic.Prompt
+ .gs { font-weight: bold } // Generic.Strong
+ .gu { color: #aaa } // Generic.Subheading
+ .gt { color: #a00 } // Generic.Traceback
+ .kc { font-weight: bold } // Keyword.Constant
+ .kd { font-weight: bold } // Keyword.Declaration
+ .kp { font-weight: bold } // Keyword.Pseudo
+ .kr { font-weight: bold } // Keyword.Reserved
+ .kt { color: #458; font-weight: bold } // Keyword.Type
+ .m { color: #099 } // Literal.Number
+ .s { color: #d14 } // Literal.String
+ .na { color: #008080 } // Name.Attribute
+ .nb { color: #0086B3 } // Name.Builtin
+ .nc { color: #458; font-weight: bold } // Name.Class
+ .no { color: #008080 } // Name.Constant
+ .ni { color: #800080 } // Name.Entity
+ .ne { color: #900; font-weight: bold } // Name.Exception
+ .nf { color: #900; font-weight: bold } // Name.Function
+ .nn { color: #777 } // Name.Namespace
+ .nt { color: #000080 } // Name.Tag
+ .nv { color: #008080 } // Name.Variable
+ .ow { font-weight: bold } // Operator.Word
+ .w { color: #bbb } // Text.Whitespace
+ .mf { color: #099 } // Literal.Number.Float
+ .mh { color: #099 } // Literal.Number.Hex
+ .mi { color: #099 } // Literal.Number.Integer
+ .mo { color: #099 } // Literal.Number.Oct
+ .sb { color: #d14 } // Literal.String.Backtick
+ .sc { color: #d14 } // Literal.String.Char
+ .sd { color: #d14 } // Literal.String.Doc
+ .s2 { color: #d14 } // Literal.String.Double
+ .se { color: #d14 } // Literal.String.Escape
+ .sh { color: #d14 } // Literal.String.Heredoc
+ .si { color: #d14 } // Literal.String.Interpol
+ .sx { color: #d14 } // Literal.String.Other
+ .sr { color: #009926 } // Literal.String.Regex
+ .s1 { color: #d14 } // Literal.String.Single
+ .ss { color: #990073 } // Literal.String.Symbol
+ .bp { color: #999 } // Name.Builtin.Pseudo
+ .vc { color: #008080 } // Name.Variable.Class
+ .vg { color: #008080 } // Name.Variable.Global
+ .vi { color: #008080 } // Name.Variable.Instance
+ .il { color: #099 } // Literal.Number.Integer.Long
+}
diff --git a/docs/assets/images/blend_face.png b/docs/assets/images/blend_face.png
new file mode 100644
index 0000000..3a6c0ce
Binary files /dev/null and b/docs/assets/images/blend_face.png differ
diff --git a/docs/assets/images/checkpoints.png b/docs/assets/images/checkpoints.png
new file mode 100644
index 0000000..1c571f9
Binary files /dev/null and b/docs/assets/images/checkpoints.png differ
diff --git a/docs/assets/images/checkpoints_use.png b/docs/assets/images/checkpoints_use.png
new file mode 100644
index 0000000..8c0a717
Binary files /dev/null and b/docs/assets/images/checkpoints_use.png differ
diff --git a/docs/assets/images/compare.png b/docs/assets/images/compare.png
new file mode 100644
index 0000000..abe57ad
Binary files /dev/null and b/docs/assets/images/compare.png differ
diff --git a/docs/assets/images/doc_mi.png b/docs/assets/images/doc_mi.png
new file mode 100644
index 0000000..c76cfb0
Binary files /dev/null and b/docs/assets/images/doc_mi.png differ
diff --git a/docs/assets/images/doc_pp.png b/docs/assets/images/doc_pp.png
new file mode 100644
index 0000000..ef56c53
Binary files /dev/null and b/docs/assets/images/doc_pp.png differ
diff --git a/docs/assets/images/doc_tab.png b/docs/assets/images/doc_tab.png
new file mode 100644
index 0000000..921d141
Binary files /dev/null and b/docs/assets/images/doc_tab.png differ
diff --git a/docs/assets/images/example1.png b/docs/assets/images/example1.png
new file mode 100644
index 0000000..a0a9fc3
Binary files /dev/null and b/docs/assets/images/example1.png differ
diff --git a/docs/assets/images/example2.png b/docs/assets/images/example2.png
new file mode 100644
index 0000000..df5ec5c
Binary files /dev/null and b/docs/assets/images/example2.png differ
diff --git a/docs/assets/images/extract.png b/docs/assets/images/extract.png
new file mode 100644
index 0000000..c842c5e
Binary files /dev/null and b/docs/assets/images/extract.png differ
diff --git a/docs/assets/images/face_units.png b/docs/assets/images/face_units.png
new file mode 100644
index 0000000..1fb28cc
Binary files /dev/null and b/docs/assets/images/face_units.png differ
diff --git a/docs/assets/images/gender.png b/docs/assets/images/gender.png
new file mode 100644
index 0000000..0863571
Binary files /dev/null and b/docs/assets/images/gender.png differ
diff --git a/docs/assets/images/install_from_url.png b/docs/assets/images/install_from_url.png
new file mode 100644
index 0000000..6ed942a
Binary files /dev/null and b/docs/assets/images/install_from_url.png differ
diff --git a/docs/assets/images/inswapper_options.png b/docs/assets/images/inswapper_options.png
new file mode 100644
index 0000000..ec8abc7
Binary files /dev/null and b/docs/assets/images/inswapper_options.png differ
diff --git a/docs/assets/images/keep_orig.png b/docs/assets/images/keep_orig.png
new file mode 100644
index 0000000..e06c5fe
Binary files /dev/null and b/docs/assets/images/keep_orig.png differ
diff --git a/docs/assets/images/main_interface.png b/docs/assets/images/main_interface.png
new file mode 100644
index 0000000..0c35569
Binary files /dev/null and b/docs/assets/images/main_interface.png differ
diff --git a/docs/assets/images/multiple_face_src.png b/docs/assets/images/multiple_face_src.png
new file mode 100644
index 0000000..4bf4bc5
Binary files /dev/null and b/docs/assets/images/multiple_face_src.png differ
diff --git a/docs/assets/images/post-processing.png b/docs/assets/images/post-processing.png
new file mode 100644
index 0000000..5a747d2
Binary files /dev/null and b/docs/assets/images/post-processing.png differ
diff --git a/docs/assets/images/postinpainting.png b/docs/assets/images/postinpainting.png
new file mode 100644
index 0000000..b5c4617
Binary files /dev/null and b/docs/assets/images/postinpainting.png differ
diff --git a/docs/assets/images/postinpainting_result.png b/docs/assets/images/postinpainting_result.png
new file mode 100644
index 0000000..d57cce1
Binary files /dev/null and b/docs/assets/images/postinpainting_result.png differ
diff --git a/docs/assets/images/settings.png b/docs/assets/images/settings.png
new file mode 100644
index 0000000..39c766e
Binary files /dev/null and b/docs/assets/images/settings.png differ
diff --git a/docs/assets/images/similarity.png b/docs/assets/images/similarity.png
new file mode 100644
index 0000000..2e01ed3
Binary files /dev/null and b/docs/assets/images/similarity.png differ
diff --git a/docs/assets/images/step1.png b/docs/assets/images/step1.png
new file mode 100644
index 0000000..2f16b41
Binary files /dev/null and b/docs/assets/images/step1.png differ
diff --git a/docs/assets/images/step2.png b/docs/assets/images/step2.png
new file mode 100644
index 0000000..8bee9cd
Binary files /dev/null and b/docs/assets/images/step2.png differ
diff --git a/docs/assets/images/step3a.png b/docs/assets/images/step3a.png
new file mode 100644
index 0000000..f7fd3f7
Binary files /dev/null and b/docs/assets/images/step3a.png differ
diff --git a/docs/assets/images/step3b.png b/docs/assets/images/step3b.png
new file mode 100644
index 0000000..008604b
Binary files /dev/null and b/docs/assets/images/step3b.png differ
diff --git a/docs/assets/images/step4.png b/docs/assets/images/step4.png
new file mode 100644
index 0000000..8e2b154
Binary files /dev/null and b/docs/assets/images/step4.png differ
diff --git a/docs/assets/images/tab.png b/docs/assets/images/tab.png
new file mode 100644
index 0000000..1249bd1
Binary files /dev/null and b/docs/assets/images/tab.png differ
diff --git a/docs/assets/images/testein.png b/docs/assets/images/testein.png
new file mode 100644
index 0000000..faaa617
Binary files /dev/null and b/docs/assets/images/testein.png differ
diff --git a/docs/assets/images/upscaled_settings.png b/docs/assets/images/upscaled_settings.png
new file mode 100644
index 0000000..25e2c64
Binary files /dev/null and b/docs/assets/images/upscaled_settings.png differ
diff --git a/docs/assets/images/upscalled_swapper.png b/docs/assets/images/upscalled_swapper.png
new file mode 100644
index 0000000..085583f
Binary files /dev/null and b/docs/assets/images/upscalled_swapper.png differ
diff --git a/docs/documentation.markdown b/docs/documentation.markdown
new file mode 100644
index 0000000..8ff5581
--- /dev/null
+++ b/docs/documentation.markdown
@@ -0,0 +1,164 @@
+---
+layout: page
+title: Documentation
+permalink: /doc/
+---
+
+# Main Interface
+
+Here is the interface for FaceSwap Lab. It is available in the form of an accordion in both img2img and txt2img.
+
+You can configure several units, each allowing you to replace a face. Here, 3 units are available: Face 1, Face 2, and Face 3. After the face replacement, the post-processing part is called.
+
+
+
+#### Face Unit
+
+The first thing to do is to activate the unit with **'enable'** if you want to use it.
+
+Here are the main options for configuring a unit:
+
++ **Reference:** This is the reference face. The face from the image will be extracted and used for face replacement. You can select which face is used with the "Reference source face" option at the bottom of the unit.
++ **Batch Source Image:** The images dropped here will be used in addition to the reference or checkpoint. If "Blend Faces" is checked, the faces will be merged into a single face by averaging the characteristics. If not, a new image will be created for each face.
++ **Face Checkpoint:** Allows you to reuse a face in the form of a checkpoint. Checkpoints are built with the build tool.
++ **Blend Faces** : Insighface works by creating an embedding for each face. An embedding is essentially a condensed representation of the facial characteristics. The face blending process allows for the averaging of multiple face embeddings to generate a blended or composite face. If face blending is enabled, the batch sources faces and the reference image will be merged into a single face. This is enabled by default.
+
+**You must always have at least one reference face OR a checkpoint. If both are selected, the checkpoint will be used and the reference ignored.**
+
+Always check for errors in the SD console. In particular, the absence of a reference face or a checkpoint can trigger errors.
+
++ **Comparison of faces** with the obtained swapped face: The swapped face can be compared to the original face using a distance function. The higher this value (from 1 to 0), the more similar the faces are. This calculation is performed if you activate **"Compute Similarity"** or **"Check Similarity"**. If you check the latter, you will have the opportunity to filter the output images with:
+ + **Min similarity:** compares the obtained face to the calculated (blended) face. If this value is not exceeded, then the face is not kept.
+ + **Min reference similarity:** compares the face to the reference face only. If this value is not exceeded, then the face is not kept.
+
++ **Selection of the face to be replaced in the image:** You can choose the face(s) to be replaced in the image by indicating their index. Faces are numbered from top-left to bottom-right starting from 0. If you check
+ + **Same gender:** the gender of the source face will be determined and only faces of the same gender will be considered.
+ + **Sort by size:** faces will be sorted from largest to smallest.
+
+#### Post-processing
+
+The post-processing window looks very much like what you might find in the extra options, except for the inpainting part. The process takes place after all units have swapped faces.
+
+The entire image and all faces will be affected by the post-processing (unlike what you might find in the upscaled inswapper options). If you're already applying a face restorer in the upscaled inswapper, the face_restorer of the post-processing will also be applied. This is probably not what you want, and in this case it might be better to leave it as None.
+
+In the current version, upscaling always occurs before face restoration.
+
+
+
+The inpainting part works in the same way as adetailer. It sends each face to img2img for transformation. This is useful for adding details to faces. The stronger the denoising, the more likely you are to lose the resemblance of the face. Some samplers seem to better preserve this resemblance than others. You can use a specific model for the replacement, different from the model used for the generation.
+
+For inpainting to be active, denoising must be greater than 0 and the Inpainting When option must be set to:
++ Never means that no inpainting will be done.
++ Before upscaling means that inpainting will occur before upscaling.
++ Before restore face means the operation will occur between upscaling and face restoration.
++ After all means that inpainting will be done last.
+
+**For now, inpainting applies to all faces, including those that have not been modified.**
+
+## Tab
+
+The tab provides access to various tools:
+
+
+
++ the use of a **batch process** with post-processing. The tool works like the main interface, except that stable diffusion is not called. Drop your images, choose a source directory (mandatory), configure the faces and click on Process&Save to get the replaced images.
++ the tool part allows you to:
+ + **build** one of the face checkpoints
+ + **compare** two faces, works the same way as the compute similarity
+ + **extract faces** from images
+ + **explore the model** (not very useful at the moment)
+ + **analyze a face** : This will give the output of the insightface analysis model on the first face found.
+
++ **Build Checkpoints**: The FaceTools tab now allows creating checkpoints, which facilitate face reuse. When a checkpoint is used, it takes precedence over the reference image, and the reference source image is discarded.
+
+The faces from different images will be merged and stored under the given face name (no special characters or spaces). All checkpoints are stored in `models/faceswaplab/faces`.
+
+Once finished, the process gives a preview of the face using the images contained in the references directory (man or woman depending on the detected gender).
+
+
+
+The checkpoint can then be used in the main interface (use refresh button)
+
+
+
+
+## Upscaled-inswapper
+
+The 'Upscaled Inswapper' is an option in SD FaceSwapLab which allows for upscaling of each face using an upscaller prior to its integration into the image. This is achieved by modifying a small segment of the InsightFace code.
+
+The purpose of this feature is to enhance the quality of the face in the final image. While this process might slightly increase the processing time, it can deliver improved results. In certain cases, this could even eliminate the need for additional tools such as Codeformer or GFPGAN in postprocessing. See the processing order section to understand when and how it is used.
+
+
+
+The upscaled inswapper is disabled by default. It can be enabled in the sd options. Understanding the various steps helps explain why results may be unsatisfactory and how to address this issue.
+
++ **upscaler** : LDSR if None. The LDSR option generally gives the best results but at the expense of a lot of computational time. You should test other models to form an opinion. The 003_realSR_BSRGAN_DFOWMFC_s64w8_SwinIR-L_x4_GAN model seems to give good results in a reasonable amount of time. It's not possible to disable upscaling, but it is possible to choose LANCZOS for speed if Codeformer is enabled in the upscaled inswapper. The result is generally satisfactory.
++ **restorer** : The face restorer to be used if necessary. Codeformer generally gives good results.
++ **sharpening** can provide more natural results, but it may also add artifacts. The same goes for **color correction**. By default, these options are set to False.
++ **improved mask:** The segmentation mask for the upscaled swapper is designed to avoid the square mask and prevent degradation of the non-face parts of the image. It is based on the Codeformer implementation. If "Use improved segmented mask (use pastenet to mask only the face)" and "upscaled inswapper" are checked in the settings, the mask will only cover the face, and will not be squared. However, depending on the image, this might introduce different types of problems such as artifacts on the border of the face.
++ **fthresh and erosion factor:** it is possible to adjust the mask erosion parameters using the fthresh and erosion settings. The higher these settings are (particularly erosion), the more the mask is reduced.
+
+## Processing order:
+
+The extension is activated after all other extensions have been processed. During the execution, several steps take place.
+
+**Step 1 :** The first step is the construction of a swapped face. For this, the faces are extracted and their resolution is reduced to a square resolution of 128px. This is the native resolution of the model and this explains why the quality suffers. The generated face is also of the same resolution.
+
+
+
+
+**Step 2 (Optionnal) :** Secondly, and **only if upscaled inswapper is enabled**, the low-resolution face is corrected by applying the selected transformations:
+
+
+
+**Step 3a (Default) :** The face is replaced in the original image. By default, InsightFace uses a square mask which it erodes to blend into the original image. This explains why clothing or other things may be affected by the replacement. When "upscaled inswapper" is used, it is possible to adjust the mask erosion parameters using the fthresh and erosion settings. The higher these settings are (particularly erosion), the more the mask is reduced.
+
+
+
+**Step 3b (improved mask) :** If the "improved mask" option is enabled and the "upscaled inswapper" is used, then a segmented mask will be calculated on both faces. Therefore, this mask will be more limited in the affected area.
+
+
+
+**Step 4 (Post-processing and inpainting options) :** Finally postprocessing and impainting are perfomed on the image.
+
+
+
+## Settings
+
+Here are the parameters that can be configured in sd settings and their default values
+
+### General Settings :
+
+ Name | Description | Default Value
+---|---|---
+ faceswaplab_model | Insightface model to use| models[0] if len(models) > 0 else "None"
+ faceswaplab_keep_original | keep original image before swapping. It true, will show original image | False
+ faceswaplab_units_count | How many faces units to use(requires restart) | 3
+ faceswaplab_detection_threshold | Detection threshold to use to detect face, if low will detect non human face as face | 0.5
+
+### Default Settings :
+
+These parameters are used to configure the default settings displayed in post-processing.
+
+ Name | Description | Default Value
+ faceswaplab_pp_default_face_restorer | UI Default post processing face restorer (requires restart) | None
+ faceswaplab_pp_default_face_restorer_visibility | UI Default post processing face restorer visibility (requires restart) | 1
+ faceswaplab_pp_default_face_restorer_weight | UI Default post processing face restorer weight (requires restart) | 1
+ faceswaplab_pp_default_upscaler | UI Default post processing upscaler (requires restart) | None
+ faceswaplab_pp_default_upscaler_visibility | UI Default post processing upscaler visibility(requires restart) | 1
+
+### Upscaled inswapper Settings :
+
+These parameters are used to control the upscaled inswapper, see above.
+
+ Name | Description | Default Value
+ faceswaplab_upscaled_swapper | Upscaled swapper. Applied only to the swapped faces. Apply transformations before merging with the original image | False
+ faceswaplab_upscaled_swapper_upscaler | Upscaled swapper upscaler (Recommended : LDSR but slow) | None
+ faceswaplab_upscaled_swapper_sharpen | Upscaled swapper sharpen | False
+ faceswaplab_upscaled_swapper_fixcolor | Upscaled swapper color correction | False
+ faceswaplab_upscaled_improved_mask | Use improved segmented mask (use pastenet to mask only the face) | True
+ faceswaplab_upscaled_swapper_face_restorer | Upscaled swapper face restorer | None
+ faceswaplab_upscaled_swapper_face_restorer_visibility | Upscaled swapper face restorer visibility | 1
+ faceswaplab_upscaled_swapper_face_restorer_weight | Upscaled swapper face restorer weight (codeformer) | 1
+ faceswaplab_upscaled_swapper_fthresh | Upscaled swapper fthresh (diff sensitivity) 10 = default behaviour. Low impact | 10
+ faceswaplab_upscaled_swapper_erosion | Upscaled swapper mask erosion factor, 1 = default behaviour. The larger it is, the more blur is applied around the face. Too large and the facial change is no longer visible | 1
\ No newline at end of file
diff --git a/docs/examples.markdown b/docs/examples.markdown
new file mode 100644
index 0000000..ad423aa
--- /dev/null
+++ b/docs/examples.markdown
@@ -0,0 +1,15 @@
+---
+layout: page
+title: Examples
+permalink: /examples/
+---
+
+These examples show how to use a painting as a source. No post-processing is activated, only the upscaled inswapper with LDSR, Codeformer and segmented mask.
+
+Moliere:
+
+
+
+Napoleon :
+
+
\ No newline at end of file
diff --git a/docs/faq.markdown b/docs/faq.markdown
new file mode 100644
index 0000000..207fe49
--- /dev/null
+++ b/docs/faq.markdown
@@ -0,0 +1,135 @@
+---
+layout: page
+title: FAQ
+permalink: /faq/
+---
+
+Our issue tracker often contains requests that may originate from a misunderstanding of the software's functionality. We aim to address these queries; however, due to time constraints, we may not be able to respond to each request individually. This FAQ section serves as a preliminary source of information for commonly raised concerns. We recommend reviewing these before submitting an issue.
+
+#### Improving Quality of Results
+
+To get better quality results:
+
+1. Ensure that the "Restore Face" option is enabled.
+2. Consider using the "Upscaler" option. For finer control, you can use an upscaler from the "Extras" tab.
+3. Use img2img with the denoise parameter set to `0.1`. Gradually increase this parameter until you achieve a balance of quality and resemblance.
+
+You can also use the uspcaled inswapper. I mainly use it with the following options :
+
+
+
+
+#### Replacing Specific Faces
+
+If an image contains multiple faces and you want to swap specific ones: Use the "Comma separated face number(s)" option to select the face numbers you wish to swap.
+
+#### Issues with Face Swapping
+
+If a face did not get swapped, please check the following:
+
+1. Ensure that the "Enable" option has been checked.
+2. If you've ensured the above and your console doesn't show any errors, it means that the FaceSwapLab was unable to detect a face in your image or the image was detected as NSFW (Not Safe For Work).
+
+#### Controversy Surrounding NSFW Content Filtering
+
+We understand that some users might wish to have the option to disable content filtering, particularly for Not Safe for Work (NSFW) content. However, it's important to clarify our stance on this matter. We are not categorically against NSFW content. The concern arises specifically when the software is used to superimpose the face of a real person onto NSFW content.
+
+If it were reliably possible to ensure that the faces being swapped were synthetic and not tied to real individuals, the inclusion of NSFW content would pose less of an ethical dilemma. However, in the absence of such a guarantee, making this feature easily accessible could potentially lead to misuse, which is an ethically risky scenario.
+
+This is not our intention to impose our moral perspectives. Our goal is to comply with the requirements of the models used in the software and establish a balanced boundary that respects individual privacy and prevents potential misuse.
+
+Requests to provide an option to disable the content filter will not be considered.
+
+#### What is the role of the segmentation mask for the upscaled swapper?
+
+The segmentation mask for the upscaled swapper is designed to avoid the square mask and prevent degradation of the non-face parts of the image. It is based on the Codeformer implementation. If "Use improved segmented mask (use pastenet to mask only the face)" and "upscaled inswapper" are checked in the settings, the mask will only cover the face, and will not be squared. However, depending on the image, this might introduce different types of problems such as artifacts on the border of the face.
+
+#### How to increase speed of upscaled inswapper?
+
+It is possible to choose LANCZOS for speed if Codeformer is enabled in the upscaled inswapper. The result is generally satisfactory.
+
+#### Sharpening and color correction in upscaled swapper :
+
+Sharpening can provide more natural results, but it may also add artifacts. The same goes for color correction. By default, these options are set to False.
+
+#### I don't see any extension after restart
+
+If you do not see any extensions after restarting, it is likely due to missing requirements, particularly if you're using Windows. Follow the instructions below:
+
+1. Verify that there are no error messages in the terminal.
+2. Double-check the Installation section of this document to ensure all the steps have been followed.
+
+If you are running a specific configuration (for example, Python 3.11), please test the extension with a clean installation of the stable version of Diffusion before reporting an issue. This can help isolate whether the problem is related to your specific configuration or a broader issue with the extension.
+
+#### Understanding Quality of Results
+
+The model used in this extension initially reduces the resolution of the target face before generating a 128x128 image. This means that regardless of the original image's size, the resolution of the processed faces will not exceed 128x128. Consequently, this lower resolution might lead to quality limitations in the results.
+
+The output of this process might not meet high expectations, but the use of the face restorer and upscaler can help improve these results to some extent.
+
+The quality of results is inherently tied to the capabilities of the model and cannot be enhanced beyond its design. FaceSwapLab merely provides an interface for the underlying model. Therefore, unless the model from insighface is retrained and necessary alterations are made in the library (see below), the resulting quality may not meet high expectations.
+
+Consider this extension as a low-cost alternative to more sophisticated tools like Lora, or as an addition to such tools. It's important to **maintain realistic expectations of the results** provided by this extension.
+
+
+#### Issue: Incorrect Gender Detection
+
+The gender detection functionality is handled by the underlying analysis model. As such, there might be instances where the detected gender may not be accurate. This is a limitation of the model and we currently do not have a way to improve this accuracy from our end.
+
+#### Why isn't GPU support included?
+
+While implementing GPU support may seem straightforward, simply requiring a modification to the onnxruntime implementation and a change in providers in the swapper, there are reasons we haven't included it as a standard option.
+
+The primary consideration is the substantial VRAM usage of the SD models. Integrating the model on the GPU doesn't result in significant performance gains with the current state of the software. Moreover, the GPU support becomes truly beneficial when processing large numbers of frames or video. However, our experience indicates that this tends to cause more issues than it resolves.
+
+Consequently, requests for GPU support as a standard feature will not be considered.
+
+#### What is the 'Upscaled Inswapper' Option in SD FaceSwapLab?
+
+The 'Upscaled Inswapper' is an option in SD FaceSwapLab which allows for upscaling of each face using an upscaller prior to its integration into the image. This is achieved by modifying a small segment of the InsightFace code.
+
+The purpose of this feature is to enhance the quality of the face in the final image. While this process might slightly increase the processing time, it can deliver improved results. In certain cases, this could even eliminate the need for additional tools such as Codeformer or GFPGAN in postprocessing.
+
+#### What is Face Blending?
+
+Insighface works by creating an embedding for each face. An embedding is essentially a condensed representation of the facial characteristics.
+
+The face blending process allows for the averaging of multiple face embeddings to generate a blended or composite face.
+
+The benefits of face blending include:
+
++ Generation of a high-quality embedding based on multiple faces, thereby improving the face's representative accuracy.
++ Creation of a composite face that includes features from multiple individuals, which can be useful for diverse face recognition scenarios.
+
+To create a composite face, two methods are available:
+
+1. Use the Checkpoint Builder: This tool allows you to save a set of face embeddings that can be loaded later to create a blended face.
+2. Use Image Batch Sources: By dropping several images into this tool, you can generate a blended face based on the faces in the provided images.
+
+#### What is a face checkpoint?
+
+A face checkpoint is a saved embedding of a face, generated from multiple images. This is accomplished via the build tool located in the `sd` tab. The build tool blends all images dropped into the tab and saves the resulting embedding to a file.
+
+The primary advantage of face checkpoints is their size. An embedding is only around 2KB, meaning it's lightweight and can be reused later without requiring additional calculations.
+
+Face checkpoints are saved as `.pkl` files. Please be aware that exchanging `.pkl` files carries potential security risks. These files, by default, are not secure and could potentially execute malicious code when opened. Therefore, extreme caution should be exercised when sharing or receiving this type of file.
+
+#### How is similarity determined?
+
+The similarity between faces is established by comparing their embeddings. In this context, a score of 1 signifies that the two faces are identical, while a score of 0 indicates that the faces are different.
+
+You can remove images from the results if the generated image does not match the reference. This is done by adjusting the sliders in the "Faces" tab.
+
+#### Which model is used?
+
+The model employed here is based on InsightFace's "InSwapper". For more specific information, you can refer [here](https://github.com/deepinsight/insightface/blob/fc622003d5410a64c96024563d7a093b2a55487c/python-package/insightface/model_zoo/inswapper.py#L12).
+
+This model was temporarily made public by the InsightFace team for research purposes. They have not provided any details about the training methodology.
+
+The model generates faces with a resolution of 128x128, which is relatively low. For better results, the generated faces need to be upscaled. The InsightFace code is not designed for higher resolutions (see the [Router](https://github.com/deepinsight/insightface/blob/fc622003d5410a64c96024563d7a093b2a55487c/python-package/insightface/model_zoo/model_zoo.py#L35) class for more information).
+
+#### Why not use SimSwap?
+
+SimSwap models are based on older InsightFace architectures, and SimSwap has not been released as a Python package. Its incorporation would complicate the process, and it does not guarantee any substantial gain.
+
+If you manage to implement SimSwap successfully, feel free to submit a pull request.
diff --git a/docs/features.markdown b/docs/features.markdown
new file mode 100644
index 0000000..f497e68
--- /dev/null
+++ b/docs/features.markdown
@@ -0,0 +1,120 @@
+---
+layout: page
+title: Features
+permalink: /features/
+---
+
++ **Face Unit Concept**: Similar to controlNet, the program introduces the concept of a face unit. You can configure up to 10 units (3 units are the default setting) in the program settings (sd).
+
+
+
++ **Vladmantic and a1111 Support**
+
++ **Batch Processing**
+
++ **Inpainting**: supports "only masked" and mask inpainting.
+
++ **Performance Improvements**: The overall performance of the software has been enhanced.
+
++ **FaceSwapLab Tab** providing various tools.
+
+
+
++ **FaceSwapLab Settings**: FaceSwapLab settings are now part of the sd settings. To access them, navigate to the sd settings section.
+
+
+
++ **Face Reuse Via Checkpoints**: The FaceTools tab now allows creating checkpoints, which facilitate face reuse. When a checkpoint is used, it takes precedence over the reference image, and the reference source image is discarded.
+
+
+
+
++ **Gender Detection**: The program can now detect gender based on faces.
+
+
+
++ **Face Combination (Blending)**: Multiple versions of a face can be combined to enhance the swapping result. This blending happens during checkpoint creation.
+
+
+
+
++ **Preserve Original Images**: You can opt to keep original images before the swapping process.
+
+
+
++ **Multiple Face Versions for Replacement**: The program allows the use of multiple versions of the same face for replacement.
+
+
+
++ **Face Similarity and Filtering**: You can compare faces against the reference and/or source images.
+
+
+
++ **Face Comparison**: face comparison feature.
+
+
+
++ **Face Extraction**: face extraction with or without upscaling.
+
+
+
++ **Improved Post-Processing**: codeformer, gfpgan, upscaling.
+
+
+
++ **Post Inpainting**: This feature allows the application of image-to-image inpainting specifically to faces.
+
+
+
+
++ **Upscaled Inswapper**: The program now includes an upscaled inswapper option, which improves results by incorporating upsampling, sharpness adjustment, and color correction before face is merged to the original image.
+
+
+
+
++ **API with typing support** :
+
+```python
+import base64
+import io
+import requests
+from PIL import Image
+from client_utils import FaceSwapRequest, FaceSwapUnit, PostProcessingOptions, FaceSwapResponse, pil_to_base64
+
+address = 'http:/127.0.0.1:7860'
+
+# First face unit :
+unit1 = FaceSwapUnit(
+ source_img=pil_to_base64("../../references/man.png"), # The face you want to use
+ faces_index=(0,) # Replace first face
+)
+
+# Second face unit :
+unit2 = FaceSwapUnit(
+ source_img=pil_to_base64("../../references/woman.png"), # The face you want to use
+ same_gender=True,
+ faces_index=(0,) # Replace first woman since same gender is on
+)
+
+# Post-processing config :
+pp = PostProcessingOptions(
+ face_restorer_name="CodeFormer",
+ codeformer_weight=0.5,
+ restorer_visibility= 1)
+
+# Prepare the request
+request = FaceSwapRequest (
+ image = pil_to_base64("test_image.png"),
+ units= [unit1, unit2],
+ postprocessing=pp
+)
+
+
+result = requests.post(url=f'{address}/faceswaplab/swap_face', data=request.json(), headers={"Content-Type": "application/json; charset=utf-8"})
+response = FaceSwapResponse.parse_obj(result.json())
+
+for img, info in zip(response.pil_images, response.infos):
+ img.show(title = info)
+
+
+```
\ No newline at end of file
diff --git a/docs/index.markdown b/docs/index.markdown
new file mode 100644
index 0000000..b6f4455
--- /dev/null
+++ b/docs/index.markdown
@@ -0,0 +1,67 @@
+---
+# Feel free to add content and custom Front Matter to this file.
+# To modify the layout, see https://jekyllrb.com/docs/themes/#overriding-theme-defaults
+
+layout: home
+---
+
+FaceSwapLab is an extension for Stable Diffusion that simplifies the use of [insighface models](https://insightface.ai/) for face-swapping. It has evolved from sd-webui-faceswap and some part of sd-webui-roop. However, a substantial amount of the code has been rewritten to improve performance and to better manage masks.
+
+Some key [features](features) include the ability to reuse faces via checkpoints, multiple face units, batch process images, sort faces based on size or gender, and support for vladmantic. It also provides a face inpainting feature.
+
+
+
+Link to github repo : [https://github.com/glucauze/sd-webui-faceswaplab](https://github.com/glucauze/sd-webui-faceswaplab)
+
+While FaceSwapLab is still under development, it has reached a good level of stability. This makes it a reliable tool for those who are interested in face-swapping within the Stable Diffusion environment. As with all projects of this type, it's expected to improve and evolve over time.
+
+
+## Disclaimer and license
+
+In short:
+
++ **Ethical Consideration:** This extension should not be forked to create a public, easy way to circumvent NSFW filtering.
++ **License:** This software is distributed under the terms of the GNU Affero General Public License (AGPL), version 3 or later.
++ **Model License:** This software uses InsightFace's pre-trained models, which are available for non-commercial research purposes only.
+
+### Ethical Perspective
+
+This extension is **not intended to facilitate the creation of not safe for work (NSFW) or non-consensual deepfake content**. Its purpose is to bring consistency to image creation, making it easier to repair existing images, or bring characters back to life.
+
+While the code for this extension is licensed under the AGPL in compliance with models and other source materials, it's important to stress that **we strongly discourage any attempts to fork this project to create an uncensored version**. Any modifications to the code to enable the production of such content would be contrary to the ethical guidelines we advocate for.
+
+We will comply with European regulations regarding this type of software. As required by law, the code may include both visible and invisible watermarks. If your local laws prohibit the use of this extension, you should not use it.
+
+From an ethical perspective, the main goal of this extension is to generate consistent images by swapping faces. It's important to note that we've done our best to integrate censorship features. However, when users can access the source code, they might bypass these censorship measures. That's why we urge users to use this extension responsibly and avoid any malicious use. We emphasize the importance of respecting people's privacy and consent when swapping faces in images. We discourage any activities that could harm others, invade their privacy, or negatively affect their well-being.
+
+Additionally, we believe it's important to make the public aware of these tools and the ease with which deepfakes can be created. As technology improves, we need to be more critical and skeptical when we encounter media content. By promoting media literacy, we can reduce the negative impact of misusing these tools and encourage responsible use in the digital world.
+
+### Software License
+
+This software is distributed under the terms of the GNU Affero General Public License (AGPL), version 3 or later. It is provided "AS IS", without any express or implied warranties, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. In no event shall the author be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. Users are encouraged to review the license in full and to use the software in accordance with its terms.
+
+If any user violates their country's legal and ethical rules, we don't accept any liability for this code repository.
+
+### Models License
+
+This software utilizes the pre-trained models `buffalo_l` and `inswapper_128.onnx`, which are provided by InsightFace. These models are included under the following conditions:
+
+_InsightFace's pre-trained models are available for non-commercial research purposes only. This includes both auto-downloading models and manually downloaded models._ from [insighface licence](https://github.com/deepinsight/insightface/tree/master/python-package)
+
+Users of this software must strictly adhere to these conditions of use. The developers and maintainers of this software are not responsible for any misuse of InsightFace's pre-trained models.
+
+Please note that if you intend to use this software for any commercial purposes, you will need to train your own models or find models that can be used commercially.
+
+## Acknowledgments
+
+This project contains code adapted from the following sources:
++ codeformer : https://github.com/sczhou/CodeFormer
++ PSFRGAN : https://github.com/chaofengc/PSFRGAN
++ insightface : https://insightface.ai/
++ ifnude : https://github.com/s0md3v/ifnude
++ sd-webui-roop : https://github.com/s0md3v/sd-webui-roop
+
+## Alternatives
+
++ https://github.com/idinkov/sd-deepface-1111
++ https://github.com/s0md3v/sd-webui-roop
diff --git a/docs/install.markdown b/docs/install.markdown
new file mode 100644
index 0000000..5584732
--- /dev/null
+++ b/docs/install.markdown
@@ -0,0 +1,47 @@
+---
+layout: page
+title: Install
+permalink: /install/
+---
+
+## Requirements/Recommanded configuration
+
+The extension runs mainly on the CPU to avoid the use of VRAM. However, it is recommended to follow the specifications recommended by sd/a1111 with regard to prerequisites. At the time of writing, a version of python lower than 11 is preferable (even if it works with python 3.11, model loading and performance may fall short of expectations).
+
+### Windows-User : Visual Studio ! Don't neglect this !
+
+Before beginning the installation process, if you are using Windows, you need to install this requirement:
+
+1. Install Visual Studio 2022: This step is required to build some of the dependencies. You can use the Community version of Visual Studio 2022, which can be downloaded from the following link: https://visualstudio.microsoft.com/downloads/
+
+2. OR Install only the VS C++ Build Tools: If you don't need the full Visual Studio suite, you can choose to install only the VS C++ Build Tools. During the installation process, select the option for "Desktop Development with C++" found under the "Workloads -> Desktop & Mobile" section. The VS C++ Build Tools can be downloaded from this link: https://visualstudio.microsoft.com/visual-cpp-build-tools/
+
+3. OR if you don't want to install either the full Visual Studio suite or the VS C++ Build Tools: Follow the instructions provided in section VIII of the documentation.
+
+## Manual Install
+
+To install the extension, follow the steps below:
+
+1. Open the `web-ui` application and navigate to the "Extensions" tab.
+2. Use the URL `https://github.com/glucauze/sd-webui-faceswaplab` in the "install from URL" section.
+3. Close the `web-ui` application and reopen it.
+
+
+
+
+**You may need to restart sd once the installation process is complete.**
+
+On first launch, templates are downloaded, which may take some time. All models are located in the `models/faceswaplab` folder.
+
+If you encounter the error `'NoneType' object has no attribute 'get'`, take the following steps:
+
+1. Download the [inswapper_128.onnx](https://huggingface.co/henryruhs/faceswaplab/resolve/main/inswapper_128.onnx) model.
+2. Place the downloaded model inside the `