Spaces:
Runtime error
Runtime error
Commit
·
98c2a34
1
Parent(s):
cb48ec9
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ from region_control import MultiDiffusion, get_views, preprocess_mask
|
|
10 |
from sketch_helper import get_high_freq_colors, color_quantization, create_binary_matrix
|
11 |
MAX_COLORS = 12
|
12 |
|
13 |
-
sd = MultiDiffusion("cuda", "2.
|
14 |
|
15 |
canvas_html = "<div id='canvas-root'></div>"
|
16 |
load_js = """
|
@@ -74,7 +74,7 @@ def process_sketch(canvas_data, binary_matrixes):
|
|
74 |
def process_generation(binary_matrixes, master_prompt, *prompts):
|
75 |
clipped_prompts = prompts[:len(binary_matrixes)]
|
76 |
prompts = [master_prompt] + list(clipped_prompts)
|
77 |
-
neg_prompts = [""] * len(prompts)
|
78 |
fg_masks = torch.cat([preprocess_mask(mask_path, 512 // 8, 512 // 8, "cuda") for mask_path in binary_matrixes])
|
79 |
bg_mask = 1 - torch.sum(fg_masks, dim=0, keepdim=True)
|
80 |
bg_mask[bg_mask < 0] = 0
|
|
|
10 |
from sketch_helper import get_high_freq_colors, color_quantization, create_binary_matrix
|
11 |
MAX_COLORS = 12
|
12 |
|
13 |
+
sd = MultiDiffusion("cuda", "2.1")
|
14 |
|
15 |
canvas_html = "<div id='canvas-root'></div>"
|
16 |
load_js = """
|
|
|
74 |
def process_generation(binary_matrixes, master_prompt, *prompts):
|
75 |
clipped_prompts = prompts[:len(binary_matrixes)]
|
76 |
prompts = [master_prompt] + list(clipped_prompts)
|
77 |
+
neg_prompts = ["low quality"] * len(prompts)
|
78 |
fg_masks = torch.cat([preprocess_mask(mask_path, 512 // 8, 512 // 8, "cuda") for mask_path in binary_matrixes])
|
79 |
bg_mask = 1 - torch.sum(fg_masks, dim=0, keepdim=True)
|
80 |
bg_mask[bg_mask < 0] = 0
|