radames commited on
Commit
f32cee9
1 Parent(s): 34d2e2b
frontend/src/app.html CHANGED
@@ -8,9 +8,7 @@
8
  <script src=""></script>
9
  %sveltekit.head%
10
  </head>
11
- <!-- <body class="dark:bg-[rgb(11,15,25)] bg-white dark:text-white text-black"> -->
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 overflow-y-scroll"
10
  >
11
  <div class="max-w-md">
12
  <h2 class="font-bold text-xl font-mono mb-8">Stable Difussion Multiplayer</h2>
13
- <p>
14
- Powered by Hugging Face face GPU Spaces <a
15
- href="https://huggingface.co/docs/hub/spaces-gpus"
16
- class="text-blue-400 hover:text-blue-600 underline"
17
- >https://huggingface.co/docs/hub/spaces-gpus</a
18
- >
19
- Diffusers
20
- <a
21
- href="https://huggingface.co/docs/diffusers/index"
22
- class="text-blue-400 hover:text-blue-600 underline"
23
- >https://huggingface.co/docs/diffusers/index</a
24
- >
25
- </p>
26
- <p>
27
- Thanks to <a
28
- href="https://twitter.com/lkwq007"
29
- target="_blank"
30
- rel="noopener noreferrer"
31
- class="text-blue-400 hover:text-blue-600 underline"
32
- >
33
- Lnyan</a
34
- >
35
- for the original outpaiting technique implemented on
36
- <a
37
- href="https://github.com/lkwq007/stablediffusion-infinity"
38
- target="_blank"
39
- rel="noopener noreferrer"
40
- class="text-blue-400 hover:text-blue-600 underline"
41
- >Stable Diffusion Infinity
42
- </a>.
43
- </p>
44
- <p class="mb-6">
45
- Runwayml Inpaiting Stable Diffusion
46
- <a
47
- href="https://github.com/runwayml/stable-diffusion"
48
- target="_blank"
49
- rel="noopener noreferrer"
50
- >
51
- https://github.com/runwayml/stable-diffusion</a
52
- >
53
- </p>
54
- <p class="text-base flex items-center">
55
- Multiplayer API by
56
- <LiveBlocks classList="ml-2" />
57
- </p>
 
 
 
 
 
 
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, Presence } 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';
 
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>paiting... </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
  >
 
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/20"
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}