Skip to content

Commit

Permalink
update sdxl
Browse files Browse the repository at this point in the history
  • Loading branch information
anapnoe committed Oct 31, 2023
1 parent f2844bd commit c76438c
Show file tree
Hide file tree
Showing 14 changed files with 325 additions and 4,794 deletions.
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,11 @@ module.exports = {
modalNextImage: "readonly",
// token-counters.js
setupTokenCounters: "readonly",
// localStorage.js
localSet: "readonly",
localGet: "readonly",
localRemove: "readonly",
// resizeHandle.js
setupResizeHandle: "writable"
}
};
180 changes: 180 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- given-names: AUTOMATIC1111
title: "Stable Diffusion Web UI"
date-released: 2022-08-22
url: "https://github.com/AUTOMATIC1111/stable-diffusion-webui"
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
* @anapnoe
* @AUTOMATIC1111

# if you were managing a localization and were removed from this file, this is because
# the intended way to do localizations now is via extensions. See:
Expand Down
7 changes: 7 additions & 0 deletions launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@


def main():
if args.dump_sysinfo:
filename = launch_utils.dump_sysinfo()

print(f"Sysinfo saved as {filename}. Exiting...")

exit(0)

launch_utils.startup_timer.record("initial startup")

with launch_utils.startup_timer.subcategory("prepare environment"):
Expand Down
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ basicsr
blendmodes
clean-fid
einops
fastapi>=0.90.1
gfpgan
gradio==3.32.0
gradio==3.41.2
inflection
jsonmerge
kornia
Expand All @@ -30,4 +31,4 @@ tomesd
torch
torchdiffeq
torchsde
transformers==4.25.1
transformers==4.30.2
14 changes: 7 additions & 7 deletions requirements_versions.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
GitPython==3.1.30
GitPython==3.1.32
Pillow==9.5.0
accelerate==0.18.0
accelerate==0.21.0
basicsr==1.4.2
blendmodes==2022
clean-fid==0.1.35
einops==0.4.1
fastapi==0.94.0
gfpgan==1.3.8
gradio==3.32.0
gradio==3.41.2
httpcore==0.15
inflection==0.5.1
jsonmerge==1.8.0
Expand All @@ -22,10 +22,10 @@ pytorch_lightning==1.9.4
realesrgan==0.3.0
resize-right==0.0.2
safetensors==0.3.1
scikit-image==0.20.0
timm==0.6.7
tomesd==0.1.2
scikit-image==0.21.0
timm==0.9.2
tomesd==0.1.3
torch
torchdiffeq==0.2.3
torchsde==0.2.5
transformers==4.25.1
transformers==4.30.2
94 changes: 47 additions & 47 deletions script.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
function gradioApp() {
const elems = document.getElementsByTagName('gradio-app');
const elem = elems.length == 0 ? document : elems[0];

if (elem !== document) {
elem.getElementById = function(id) {
return document.getElementById(id);
};
}
return elem.shadowRoot ? elem.shadowRoot : elem;
const elems = document.getElementsByTagName('gradio-app');
const elem = elems.length == 0 ? document : elems[0];

if (elem !== document) {
elem.getElementById = function(id) {
return document.getElementById(id);
};
}
return elem.shadowRoot ? elem.shadowRoot : elem;
}

/**
Expand Down Expand Up @@ -37,7 +37,7 @@ var uiCurrentTab = null;
* The callback receives an array of MutationRecords as an argument.
*/
function onUiUpdate(callback) {
uiUpdateCallbacks.push(callback);
uiUpdateCallbacks.push(callback);
}

/**
Expand All @@ -57,15 +57,15 @@ function onAfterUiUpdate(callback) {
* The callback receives no arguments.
*/
function onUiLoaded(callback) {
uiLoadedCallbacks.push(callback);
uiLoadedCallbacks.push(callback);
}

/**
* Register callback to be called when the UI tab is changed.
* The callback receives no arguments.
*/
function onUiTabChange(callback) {
uiTabChangeCallbacks.push(callback);
uiTabChangeCallbacks.push(callback);
}

/**
Expand All @@ -74,7 +74,7 @@ function onUiTabChange(callback) {
* @param callback
*/
function onOptionsChanged(callback) {
optionsChangedCallbacks.push(callback);
optionsChangedCallbacks.push(callback);
}

function executeCallbacks(queue, arg) {
Expand Down Expand Up @@ -103,11 +103,11 @@ function scheduleAfterUiUpdateCallbacks() {
var executedOnLoaded = false;

document.addEventListener("DOMContentLoaded", function() {
var mutationObserver = new MutationObserver(function(m) {
if (!executedOnLoaded && gradioApp().querySelector('#txt2img_prompt')) {
executedOnLoaded = true;
executeCallbacks(uiLoadedCallbacks);
}
var mutationObserver = new MutationObserver(function(m) {
if (!executedOnLoaded && gradioApp().querySelector('#txt2img_prompt')) {
executedOnLoaded = true;
executeCallbacks(uiLoadedCallbacks);
}

executeCallbacks(uiUpdateCallbacks, m);
scheduleAfterUiUpdateCallbacks();
Expand All @@ -121,43 +121,43 @@ document.addEventListener("DOMContentLoaded", function() {
});

/**
* Add a ctrl+enter as a shortcut to start a generation
*/
* Add a ctrl+enter as a shortcut to start a generation
*/
document.addEventListener('keydown', function(e) {
var handled = false;
if (e.key !== undefined) {
if ((e.key == "Enter" && (e.metaKey || e.ctrlKey || e.altKey))) handled = true;
} else if (e.keyCode !== undefined) {
if ((e.keyCode == 13 && (e.metaKey || e.ctrlKey || e.altKey))) handled = true;
}
if (handled) {
var button = get_uiCurrentTabContent().querySelector('button[id$=_generate]');
if (button) {
button.click();
}
e.preventDefault();
}
var handled = false;
if (e.key !== undefined) {
if ((e.key == "Enter" && (e.metaKey || e.ctrlKey || e.altKey))) handled = true;
} else if (e.keyCode !== undefined) {
if ((e.keyCode == 13 && (e.metaKey || e.ctrlKey || e.altKey))) handled = true;
}
if (handled) {
var button = get_uiCurrentTabContent().querySelector('button[id$=_generate]');
if (button) {
button.click();
}
e.preventDefault();
}
});

/**
* checks that a UI element is not in another hidden element or tab content
*/
* checks that a UI element is not in another hidden element or tab content
*/
function uiElementIsVisible(el) {
if (el === document) {
return true;
}
if (el === document) {
return true;
}

const computedStyle = getComputedStyle(el);
const isVisible = computedStyle.display !== 'none';
const computedStyle = getComputedStyle(el);
const isVisible = computedStyle.display !== 'none';

if (!isVisible) return false;
return uiElementIsVisible(el.parentNode);
if (!isVisible) return false;
return uiElementIsVisible(el.parentNode);
}

function uiElementInSight(el) {
const clRect = el.getBoundingClientRect();
const windowHeight = window.innerHeight;
const isOnScreen = clRect.bottom > 0 && clRect.top < windowHeight;
const clRect = el.getBoundingClientRect();
const windowHeight = window.innerHeight;
const isOnScreen = clRect.bottom > 0 && clRect.top < windowHeight;

return isOnScreen;
}
return isOnScreen;
}
Loading

0 comments on commit c76438c

Please sign in to comment.