Spaces:
Runtime error
Runtime error
missing prompt update
Browse files- app-controlnet.py +1 -1
- txt2img/index.html +5 -2
app-controlnet.py
CHANGED
@@ -102,7 +102,7 @@ if psutil.virtual_memory().total < 64 * 1024**3:
|
|
102 |
|
103 |
if not mps_available and not xpu_available:
|
104 |
pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
|
105 |
-
pipe(prompt="warmup", image=[Image.new("RGB", (
|
106 |
|
107 |
compel_proc = Compel(
|
108 |
tokenizer=pipe.tokenizer,
|
|
|
102 |
|
103 |
if not mps_available and not xpu_available:
|
104 |
pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
|
105 |
+
pipe(prompt="warmup", image=[Image.new("RGB", (768, 768))], control_image=[Image.new("RGB", (768, 768))])
|
106 |
|
107 |
compel_proc = Compel(
|
108 |
tokenizer=pipe.tokenizer,
|
txt2img/index.html
CHANGED
@@ -29,8 +29,9 @@
|
|
29 |
const errorEl = document.querySelector("#error");
|
30 |
const snapBtn = document.querySelector("#snap");
|
31 |
const paramsEl = document.querySelector("#params");
|
|
|
32 |
paramsEl.addEventListener("submit", (e) => e.preventDefault());
|
33 |
-
function LCMLive(paramsEl, liveImage) {
|
34 |
let websocket;
|
35 |
|
36 |
async function start() {
|
@@ -98,11 +99,13 @@
|
|
98 |
function initPromptStream(userId) {
|
99 |
liveImage.src = `/stream/${userId}`;
|
100 |
paramsEl.addEventListener("change", debouncedInput);
|
|
|
101 |
}
|
102 |
|
103 |
async function stop() {
|
104 |
websocket.close();
|
105 |
paramsEl.removeEventListener("change", debouncedInput);
|
|
|
106 |
}
|
107 |
return {
|
108 |
start,
|
@@ -158,7 +161,7 @@
|
|
158 |
}
|
159 |
|
160 |
|
161 |
-
const lcmLive = LCMLive(paramsEl, imageEl);
|
162 |
startBtn.addEventListener("click", async () => {
|
163 |
try {
|
164 |
startBtn.disabled = true;
|
|
|
29 |
const errorEl = document.querySelector("#error");
|
30 |
const snapBtn = document.querySelector("#snap");
|
31 |
const paramsEl = document.querySelector("#params");
|
32 |
+
const promptEl = document.querySelector("#prompt");
|
33 |
paramsEl.addEventListener("submit", (e) => e.preventDefault());
|
34 |
+
function LCMLive(promptEl, paramsEl, liveImage) {
|
35 |
let websocket;
|
36 |
|
37 |
async function start() {
|
|
|
99 |
function initPromptStream(userId) {
|
100 |
liveImage.src = `/stream/${userId}`;
|
101 |
paramsEl.addEventListener("change", debouncedInput);
|
102 |
+
promptEl.addEventListener("input", debouncedInput);
|
103 |
}
|
104 |
|
105 |
async function stop() {
|
106 |
websocket.close();
|
107 |
paramsEl.removeEventListener("change", debouncedInput);
|
108 |
+
promptEl.removeEventListener("input", debouncedInput);
|
109 |
}
|
110 |
return {
|
111 |
start,
|
|
|
161 |
}
|
162 |
|
163 |
|
164 |
+
const lcmLive = LCMLive(promptEl, paramsEl, imageEl);
|
165 |
startBtn.addEventListener("click", async () => {
|
166 |
try {
|
167 |
startBtn.disabled = true;
|