Spaces:
Runtime error
Runtime error
lixiang46
commited on
Commit
·
15341ef
1
Parent(s):
3ec5036
debug
Browse files
app.py
CHANGED
|
@@ -8,7 +8,6 @@ from kolors.models.tokenization_chatglm import ChatGLMTokenizer
|
|
| 8 |
from diffusers import AutoencoderKL, EulerDiscreteScheduler, UNet2DConditionModel
|
| 9 |
import gradio as gr
|
| 10 |
import numpy as np
|
| 11 |
-
from PIL import Image
|
| 12 |
|
| 13 |
device = "cuda"
|
| 14 |
ckpt_dir = snapshot_download(repo_id="Kwai-Kolors/Kolors-Inpainting")
|
|
@@ -43,7 +42,7 @@ def infer(prompt,
|
|
| 43 |
num_inference_steps = 25
|
| 44 |
):
|
| 45 |
if mask_image != None:
|
| 46 |
-
image = dict({'background': image, 'layers': [
|
| 47 |
if randomize_seed:
|
| 48 |
seed = random.randint(0, MAX_SEED)
|
| 49 |
generator = torch.Generator().manual_seed(seed)
|
|
|
|
| 8 |
from diffusers import AutoencoderKL, EulerDiscreteScheduler, UNet2DConditionModel
|
| 9 |
import gradio as gr
|
| 10 |
import numpy as np
|
|
|
|
| 11 |
|
| 12 |
device = "cuda"
|
| 13 |
ckpt_dir = snapshot_download(repo_id="Kwai-Kolors/Kolors-Inpainting")
|
|
|
|
| 42 |
num_inference_steps = 25
|
| 43 |
):
|
| 44 |
if mask_image != None:
|
| 45 |
+
image = dict({'background': image, 'layers': [mask_image]})
|
| 46 |
if randomize_seed:
|
| 47 |
seed = random.randint(0, MAX_SEED)
|
| 48 |
generator = torch.Generator().manual_seed(seed)
|