Spaces:
Running
on
Zero
Running
on
Zero
minor fixes
Browse files
app.py
CHANGED
|
@@ -43,14 +43,9 @@ pipe = StableDiffusionXLFillPipeline.from_pretrained(
|
|
| 43 |
controlnet=model,
|
| 44 |
variant="fp16",
|
| 45 |
)
|
| 46 |
-
pipe = StableDiffusionXLFillPipeline.from_pretrained(
|
| 47 |
-
"GraydientPlatformAPI/lustify-lightning",
|
| 48 |
-
torch_dtype=torch.float16,
|
| 49 |
-
vae=vae,
|
| 50 |
-
controlnet=model,
|
| 51 |
-
)
|
| 52 |
pipe.scheduler = TCDScheduler.from_config(pipe.scheduler.config)
|
| 53 |
pipe.to("cuda")
|
|
|
|
| 54 |
|
| 55 |
@spaces.GPU(duration=12)
|
| 56 |
def fill_image(prompt, image, model_selection, paste_back):
|
|
@@ -198,6 +193,7 @@ def inpaint(prompt, image, inpaint_model, paste_back):
|
|
| 198 |
vae=vae,
|
| 199 |
controlnet=model,
|
| 200 |
).to("cuda")
|
|
|
|
| 201 |
mask = Image.fromarray(image["mask"]).convert("L")
|
| 202 |
image = Image.fromarray(image["image"])
|
| 203 |
inpaint_final_prompt = f"score_9, score_8_up, score_7_up, {prompt}"
|
|
@@ -214,6 +210,7 @@ def outpaint(image, width, height, overlap_percentage, num_inference_steps, resi
|
|
| 214 |
cnet_image = background.copy()
|
| 215 |
cnet_image.paste(0, (0, 0), mask)
|
| 216 |
final_prompt = f"score_9, score_8_up, score_7_up, {prompt_input} , high quality, 4k"
|
|
|
|
| 217 |
(
|
| 218 |
prompt_embeds,
|
| 219 |
negative_prompt_embeds,
|
|
|
|
| 43 |
controlnet=model,
|
| 44 |
variant="fp16",
|
| 45 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
pipe.scheduler = TCDScheduler.from_config(pipe.scheduler.config)
|
| 47 |
pipe.to("cuda")
|
| 48 |
+
print(pipe)
|
| 49 |
|
| 50 |
@spaces.GPU(duration=12)
|
| 51 |
def fill_image(prompt, image, model_selection, paste_back):
|
|
|
|
| 193 |
vae=vae,
|
| 194 |
controlnet=model,
|
| 195 |
).to("cuda")
|
| 196 |
+
print(f"Loaded new SDXL model: {pipe.config.model_name}")
|
| 197 |
mask = Image.fromarray(image["mask"]).convert("L")
|
| 198 |
image = Image.fromarray(image["image"])
|
| 199 |
inpaint_final_prompt = f"score_9, score_8_up, score_7_up, {prompt}"
|
|
|
|
| 210 |
cnet_image = background.copy()
|
| 211 |
cnet_image.paste(0, (0, 0), mask)
|
| 212 |
final_prompt = f"score_9, score_8_up, score_7_up, {prompt_input} , high quality, 4k"
|
| 213 |
+
print(f"Outpainting using SDXL model: {pipe.config.model_name}")
|
| 214 |
(
|
| 215 |
prompt_embeds,
|
| 216 |
negative_prompt_embeds,
|