Spaces:
Runtime error
Runtime error
spells
Browse files
frontend/src/app.html
CHANGED
@@ -8,9 +8,7 @@
|
|
8 |
<script src=""></script>
|
9 |
%sveltekit.head%
|
10 |
</head>
|
11 |
-
|
12 |
-
|
13 |
-
<body class="bg-blue-200/20">
|
14 |
<div>%sveltekit.body%</div>
|
15 |
</body>
|
16 |
|
|
|
8 |
<script src=""></script>
|
9 |
%sveltekit.head%
|
10 |
</head>
|
11 |
+
<body class="bg-blue-200">
|
|
|
|
|
12 |
<div>%sveltekit.body%</div>
|
13 |
</body>
|
14 |
|
frontend/src/lib/About.svelte
CHANGED
@@ -6,54 +6,60 @@
|
|
6 |
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
7 |
<div
|
8 |
on:click
|
9 |
-
class="fixed {classList} w-screen h-screen top-0 left-0 bottom-0 right-0 z-50 items-center justify-center bg-black text-white bg-opacity-90 px-3
|
10 |
>
|
11 |
<div class="max-w-md">
|
12 |
<h2 class="font-bold text-xl font-mono mb-8">Stable Difussion Multiplayer</h2>
|
13 |
-
<
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
</div>
|
59 |
</div>
|
|
|
6 |
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
7 |
<div
|
8 |
on:click
|
9 |
+
class="fixed {classList} w-screen h-screen top-0 left-0 bottom-0 right-0 z-50 items-center justify-center bg-black text-white bg-opacity-90 px-3"
|
10 |
>
|
11 |
<div class="max-w-md">
|
12 |
<h2 class="font-bold text-xl font-mono mb-8">Stable Difussion Multiplayer</h2>
|
13 |
+
<ul>
|
14 |
+
<li class="mb-2">
|
15 |
+
Powered by <a
|
16 |
+
href="https://huggingface.co/docs/hub/spaces-gpus"
|
17 |
+
class="text-blue-400 hover:text-blue-600 underline"
|
18 |
+
>Hugging Face GPU Spaces
|
19 |
+
</a>
|
20 |
+
</li>
|
21 |
+
<li class="mb-2">
|
22 |
+
<a
|
23 |
+
href="https://huggingface.co/docs/diffusers/index"
|
24 |
+
class="text-blue-400 hover:text-blue-600 underline"
|
25 |
+
>
|
26 |
+
Diffusers
|
27 |
+
</a>
|
28 |
+
and
|
29 |
+
<a
|
30 |
+
href="https://github.com/runwayml/stable-diffusion"
|
31 |
+
target="_blank"
|
32 |
+
class="text-blue-400 hover:text-blue-600 underline"
|
33 |
+
rel="noopener noreferrer"
|
34 |
+
>
|
35 |
+
Runwayml Inpaiting Stable Diffusion</a
|
36 |
+
>
|
37 |
+
</li>
|
38 |
+
<li class="mb-2">
|
39 |
+
Thanks to <a
|
40 |
+
href="https://twitter.com/lkwq007"
|
41 |
+
target="_blank"
|
42 |
+
rel="noopener noreferrer"
|
43 |
+
class="text-blue-400 hover:text-blue-600 underline"
|
44 |
+
>
|
45 |
+
Lnyan</a
|
46 |
+
>
|
47 |
+
for the original outpainting technique implemented on
|
48 |
+
<a
|
49 |
+
href="https://github.com/lkwq007/stablediffusion-infinity"
|
50 |
+
target="_blank"
|
51 |
+
rel="noopener noreferrer"
|
52 |
+
class="text-blue-400 hover:text-blue-600 underline"
|
53 |
+
>Stable Diffusion Infinity
|
54 |
+
</a>
|
55 |
+
</li>
|
56 |
+
|
57 |
+
<li class="mb-2">
|
58 |
+
<p class="text-base flex items-center">
|
59 |
+
Multiplayer API by
|
60 |
+
<LiveBlocks classList="ml-2" />
|
61 |
+
</p>
|
62 |
+
</li>
|
63 |
+
</ul>
|
64 |
</div>
|
65 |
</div>
|
frontend/src/lib/App.svelte
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
import PromptModal from '$lib/PromptModal.svelte';
|
9 |
import { COLORS } from '$lib/constants';
|
10 |
import { PUBLIC_WS_INPAINTING } from '$env/static/public';
|
11 |
-
import type { PromptImgKey
|
12 |
import { Status } from '$lib/types';
|
13 |
import { loadingState, currZoomTransform, maskEl } from '$lib/store';
|
14 |
import { useMyPresence, useObject, useOthers } from '$lib/liveblocks';
|
|
|
8 |
import PromptModal from '$lib/PromptModal.svelte';
|
9 |
import { COLORS } from '$lib/constants';
|
10 |
import { PUBLIC_WS_INPAINTING } from '$env/static/public';
|
11 |
+
import type { PromptImgKey } from '$lib/types';
|
12 |
import { Status } from '$lib/types';
|
13 |
import { loadingState, currZoomTransform, maskEl } from '$lib/store';
|
14 |
import { useMyPresence, useObject, useOthers } from '$lib/liveblocks';
|
frontend/src/lib/Buttons/PPButton.svelte
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
title="Prompt and Paint"
|
10 |
>
|
11 |
{#if isLoading}
|
12 |
-
<span>
|
13 |
<span
|
14 |
class="rounded-sm h-4 w-4 flex justify-center items-center border-2 border-dashed border-violet-700 mr-2"
|
15 |
>
|
|
|
9 |
title="Prompt and Paint"
|
10 |
>
|
11 |
{#if isLoading}
|
12 |
+
<span>painting... </span>{:else}
|
13 |
<span
|
14 |
class="rounded-sm h-4 w-4 flex justify-center items-center border-2 border-dashed border-violet-700 mr-2"
|
15 |
>
|
frontend/src/lib/PaintCanvas.svelte
CHANGED
@@ -68,7 +68,7 @@
|
|
68 |
//https://bl.ocks.org/fabiovalse/b9224bfd64ca96c47f8cdcb57b35b8e2
|
69 |
const kw = (W - margin) / w;
|
70 |
const kh = (H - margin) / h;
|
71 |
-
const k = min([kw, kh]);
|
72 |
const x = W / 2 - center.x * k;
|
73 |
const y = H / 2 - center.y * k;
|
74 |
return zoomIdentity.translate(x, y).scale(k);
|
@@ -113,6 +113,7 @@
|
|
113 |
(containerEl.clientHeight > containerEl.clientWidth
|
114 |
? containerEl.clientWidth
|
115 |
: containerEl.clientHeight);
|
|
|
116 |
selection.call(
|
117 |
zoomHandler.transform as any,
|
118 |
to_bbox(
|
@@ -189,7 +190,7 @@
|
|
189 |
|
190 |
<div
|
191 |
bind:this={containerEl}
|
192 |
-
class="absolute top-0 left-0 right-0 bottom-0 overflow-hidden z-0 bg-blue-200
|
193 |
>
|
194 |
<canvas
|
195 |
bind:this={$canvasEl}
|
|
|
68 |
//https://bl.ocks.org/fabiovalse/b9224bfd64ca96c47f8cdcb57b35b8e2
|
69 |
const kw = (W - margin) / w;
|
70 |
const kh = (H - margin) / h;
|
71 |
+
const k = min([kw, kh]) || 1;
|
72 |
const x = W / 2 - center.x * k;
|
73 |
const y = H / 2 - center.y * k;
|
74 |
return zoomIdentity.translate(x, y).scale(k);
|
|
|
113 |
(containerEl.clientHeight > containerEl.clientWidth
|
114 |
? containerEl.clientWidth
|
115 |
: containerEl.clientHeight);
|
116 |
+
zoomHandler.scaleExtent([1 / scale / 2, 3]);
|
117 |
selection.call(
|
118 |
zoomHandler.transform as any,
|
119 |
to_bbox(
|
|
|
190 |
|
191 |
<div
|
192 |
bind:this={containerEl}
|
193 |
+
class="absolute top-0 left-0 right-0 bottom-0 overflow-hidden z-0 bg-blue-200"
|
194 |
>
|
195 |
<canvas
|
196 |
bind:this={$canvasEl}
|