Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds soft inpainting #284

Merged
merged 14 commits into from
Mar 2, 2024
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ this is a completely vanilla javascript and html canvas outpainting convenience

## features

- [soft inpainting](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/14208) support
- SDXL "support"! (please check outpaint/inpaint fill types in the context menus and fiddle with denoising a LOT for img2img, it's touchy)
- [now available as an extension for webUI!](https://github.com/zero01101/openOutpaint-webUI-extension) you can find it under the default "available" section in the webUI _extensions_ tab
- **_NOTE: extension still requires `--api` flag in webui-user launch script_**
Expand Down
6 changes: 6 additions & 0 deletions css/icons.css
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,9 @@
-webkit-mask-image: url("../res/icons/clipboard-list.svg");
mask-image: url("../res/icons/clipboard-list.svg");
}

.ui.inline-icon.icon-squircle::after,
.ui.icon > .icon-squircle {
-webkit-mask-image: url("../res/icons/squircle.svg");
mask-image: url("../res/icons/squircle.svg");
}
16 changes: 8 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>openOutpaint 🐠</title>
<!-- CSS Variables -->
<link href="css/colors.css?v=f732f19" rel="stylesheet" />
<link href="css/icons.css?v=e6f94af" rel="stylesheet" />
<link href="css/icons.css?v=1640e24" rel="stylesheet" />

<link href="css/index.css?v=cf6b502" rel="stylesheet" />
<link href="css/layers.css?v=92c0352" rel="stylesheet" />
Expand Down Expand Up @@ -186,12 +186,12 @@
<label id="hrFixLabel" class="hrfix">Choose HRfix upscaler</label>
<div id="hrFixUpscaler" class="hrfix"></div>
<div id="hrDenoising" class="hrfix"></div>
<input
<!-- <input
type="checkbox"
id="cbxRestoreFaces"
onchange="changeRestoreFaces()" />
<label for="cbxRestoreFaces">Restore Faces</label>
<br />
<br /> -->
<input
type="checkbox"
id="cbxSyncCursorSize"
Expand Down Expand Up @@ -337,7 +337,7 @@
<br />
<span id="version">
<a href="https://github.com/zero01101/openOutpaint" target="_blank">
v20240127.001
v20240302.001
</a>
<br />
<a
Expand Down Expand Up @@ -534,7 +534,7 @@
<!-- Basics -->
<script src="js/global.js?v=ac30d16" type="text/javascript"></script>
<script src="js/defaults.js?v=5b06818" type="text/javascript"></script>
<script src="js/extensions.js?v=0bd1fbe" type="text/javascript"></script>
<script src="js/extensions.js?v=5102854" type="text/javascript"></script>

<!-- Base Libs -->
<script src="js/lib/util.js?v=379aef7" type="text/javascript"></script>
Expand All @@ -560,7 +560,7 @@

<!-- Content -->
<script src="js/prompt.js?v=7a1c68c" type="text/javascript"></script>
<script src="js/index.js?v=70af18f" type="text/javascript"></script>
<script src="js/index.js?v=206c7df" type="text/javascript"></script>

<script
src="js/ui/floating/history.js?v=4f29db4"
Expand All @@ -574,7 +574,7 @@
src="js/ui/tool/generic.js?v=3e678e0"
type="text/javascript"></script>

<script src="js/ui/tool/dream.js?v=be5099a" type="text/javascript"></script>
<script src="js/ui/tool/dream.js?v=56c7c50" type="text/javascript"></script>
<script
src="js/ui/tool/maskbrush.js?v=e9bd0eb"
type="text/javascript"></script>
Expand All @@ -584,7 +584,7 @@
<script
src="js/ui/tool/select.js?v=76df58e"
type="text/javascript"></script>
<script src="js/ui/tool/stamp.js?v=b4d414d" type="text/javascript"></script>
<script src="js/ui/tool/stamp.js?v=fdca5bc" type="text/javascript"></script>
<script
src="js/ui/tool/interrogate.js?v=dd45b4a"
type="text/javascript"></script>
Expand Down
7 changes: 7 additions & 0 deletions js/extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
const extensions = {
// alwaysOnScriptsData: {},
alwaysOnScripts: false,
// softInpaintingEnabled: false, //???
controlNetEnabled: false,
controlNetActive: false,
controlNetReferenceActive: false,
Expand Down Expand Up @@ -53,6 +54,7 @@ const extensions = {
console.warn("[index] Failed to fetch extensions");
console.warn(e);
}
this.checkForSoftInpainting();
this.checkForDynamicPrompts();
this.checkForControlNet(
controlNetModelAutoComplete,
Expand All @@ -64,6 +66,11 @@ const extensions = {
//checkForSAG(); //??
},

async checkForSoftInpainting() {
this.alwaysOnScripts = true;
//TODO implement, inpaint/img2img only
},

async checkForDynamicPrompts() {
if (
this.enabledExtensions.filter((e) => e.includes("dynamic prompts"))
Expand Down
4 changes: 2 additions & 2 deletions js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ function startup() {
changeRefinerEnabled();
changeHiResFix();
changeHiResSquare();
changeRestoreFaces();
// changeRestoreFaces();
changeSyncCursorSize();
changeControlNetExtension();
changeControlNetReference();
Expand Down Expand Up @@ -1558,7 +1558,7 @@ function loadSettings() {
document.getElementById("maskBlur").value = Number(_mask_blur);
document.getElementById("seed").value = Number(_seed);
document.getElementById("cbxHRFix").checked = Boolean(_enable_hr);
document.getElementById("cbxRestoreFaces").checked = Boolean(_restore_faces);
// document.getElementById("cbxRestoreFaces").checked = Boolean(_restore_faces);
document.getElementById("cbxSyncCursorSize").checked =
Boolean(_sync_cursor_size);
document.getElementById("hrFixScale").value = Number(_hrfix_scale);
Expand Down
Loading
Loading