Update app.py
Browse files
app.py
CHANGED
|
@@ -23,13 +23,11 @@ device = "cuda"
|
|
| 23 |
|
| 24 |
sd_base_id = "runwayml/stable-diffusion-v1-5"
|
| 25 |
|
| 26 |
-
print("Loading SD 1.5...")
|
| 27 |
pipe_sd = StableDiffusionPipeline.from_pretrained(
|
| 28 |
sd_base_id,
|
| 29 |
torch_dtype=torch.float16
|
| 30 |
).to("cpu")
|
| 31 |
|
| 32 |
-
print("Loading Krea Pipeline & Transformer...")
|
| 33 |
pipe_krea = DiffusionPipeline.from_pretrained(
|
| 34 |
"krea/Krea-2-Turbo",
|
| 35 |
dtype=dtype,
|
|
@@ -89,9 +87,6 @@ def infer(
|
|
| 89 |
pipe_krea.to(device)
|
| 90 |
image = pipe_krea(
|
| 91 |
prompt=prompt,
|
| 92 |
-
image=input_image,
|
| 93 |
-
strength=image_strength,
|
| 94 |
-
guidance_scale=guidance_scale,
|
| 95 |
num_inference_steps=int(diff_steps),
|
| 96 |
generator=generator,
|
| 97 |
).images[0]
|
|
@@ -119,9 +114,6 @@ def infer(
|
|
| 119 |
pipe_krea.to(device)
|
| 120 |
image = pipe_krea(
|
| 121 |
prompt=prompt,
|
| 122 |
-
image=base_image,
|
| 123 |
-
strength=image_strength,
|
| 124 |
-
guidance_scale=guidance_scale,
|
| 125 |
num_inference_steps=int(diff_steps),
|
| 126 |
generator=generator,
|
| 127 |
).images[0]
|
|
|
|
| 23 |
|
| 24 |
sd_base_id = "runwayml/stable-diffusion-v1-5"
|
| 25 |
|
|
|
|
| 26 |
pipe_sd = StableDiffusionPipeline.from_pretrained(
|
| 27 |
sd_base_id,
|
| 28 |
torch_dtype=torch.float16
|
| 29 |
).to("cpu")
|
| 30 |
|
|
|
|
| 31 |
pipe_krea = DiffusionPipeline.from_pretrained(
|
| 32 |
"krea/Krea-2-Turbo",
|
| 33 |
dtype=dtype,
|
|
|
|
| 87 |
pipe_krea.to(device)
|
| 88 |
image = pipe_krea(
|
| 89 |
prompt=prompt,
|
|
|
|
|
|
|
|
|
|
| 90 |
num_inference_steps=int(diff_steps),
|
| 91 |
generator=generator,
|
| 92 |
).images[0]
|
|
|
|
| 114 |
pipe_krea.to(device)
|
| 115 |
image = pipe_krea(
|
| 116 |
prompt=prompt,
|
|
|
|
|
|
|
|
|
|
| 117 |
num_inference_steps=int(diff_steps),
|
| 118 |
generator=generator,
|
| 119 |
).images[0]
|