Spaces:
Sleeping
Sleeping
commit
Browse files
app.py
CHANGED
@@ -434,8 +434,8 @@ pegasus_name = "google/pegasus-xsum"
|
|
434 |
# precision data
|
435 |
|
436 |
seq=512
|
437 |
-
width=
|
438 |
-
height=
|
439 |
image_steps=8
|
440 |
img_accu=0
|
441 |
|
@@ -519,7 +519,7 @@ def upscaler(
|
|
519 |
tile_width: int = 112,
|
520 |
tile_height: int = 144,
|
521 |
denoise_strength: float = 0.35,
|
522 |
-
num_inference_steps: int =
|
523 |
solver: str = "DDIM",
|
524 |
) -> Image.Image:
|
525 |
|
@@ -595,15 +595,15 @@ def add_song_cover_text(img,artist,song,height,width):
|
|
595 |
x = math.ceil((width - textwidth) / 2)
|
596 |
y = height - (textheight * rows / 2) - (height / 2)
|
597 |
y = math.ceil(y - (height / 2 * labels_distance))
|
598 |
-
draw.text((x, y), song, (255,255,255), font=font, spacing=2, stroke_width=
|
599 |
|
600 |
-
textheight=min(math.ceil( width /
|
601 |
font = ImageFont.truetype(r"Alef-Bold.ttf", textheight)
|
602 |
textwidth = draw.textlength(artist,font)
|
603 |
x = math.ceil((width - textwidth) / 2)
|
604 |
y = height - (textheight * rows / 2) - (height / 2)
|
605 |
y = math.ceil(y + (height / 2 * labels_distance))
|
606 |
-
draw.text((x, y), artist, (
|
607 |
|
608 |
return img
|
609 |
|
|
|
434 |
# precision data
|
435 |
|
436 |
seq=512
|
437 |
+
width=720
|
438 |
+
height=720
|
439 |
image_steps=8
|
440 |
img_accu=0
|
441 |
|
|
|
519 |
tile_width: int = 112,
|
520 |
tile_height: int = 144,
|
521 |
denoise_strength: float = 0.35,
|
522 |
+
num_inference_steps: int = 50,
|
523 |
solver: str = "DDIM",
|
524 |
) -> Image.Image:
|
525 |
|
|
|
595 |
x = math.ceil((width - textwidth) / 2)
|
596 |
y = height - (textheight * rows / 2) - (height / 2)
|
597 |
y = math.ceil(y - (height / 2 * labels_distance))
|
598 |
+
draw.text((x, y), song, (255,255,255,85), font=font, spacing=2, stroke_width=math.ceil(textheight/20), stroke_fill=(0,0,0,170))
|
599 |
|
600 |
+
textheight=min(math.ceil( width / 10 ), math.ceil( height / 5 ))
|
601 |
font = ImageFont.truetype(r"Alef-Bold.ttf", textheight)
|
602 |
textwidth = draw.textlength(artist,font)
|
603 |
x = math.ceil((width - textwidth) / 2)
|
604 |
y = height - (textheight * rows / 2) - (height / 2)
|
605 |
y = math.ceil(y + (height / 2 * labels_distance))
|
606 |
+
draw.text((x, y), artist, (0,0,0,85), font=font, spacing=2, stroke_width=math.ceil(textheight/20), stroke_fill=(255,255,255,170))
|
607 |
|
608 |
return img
|
609 |
|