update title example and workflow

This commit is contained in:
chflame163
2024-02-16 19:43:14 +08:00
parent f3cff7bb11
commit 56aadc17b1
7 changed files with 856 additions and 308 deletions
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 MiB

After

Width:  |  Height:  |  Size: 3.9 MiB

+1 -1
View File
@@ -898,7 +898,7 @@ def random_numbers(total:int, random_range:int, seed:int=0, sum_of_numbers:int=0
ret_list = []
for i in numbers:
ret_list.append(i - avg)
ret_list.append(sum_of_numbers - sum(ret_list))
ret_list.append((sum_of_numbers - sum(ret_list)) // 2)
return ret_list
'''CLASS'''
+6 -6
View File
@@ -45,9 +45,9 @@ class TextImage:
size_as=None
):
spacing -= 20
leading += 20
scale *= 0.7
# spacing -= 20
# leading += 20
# scale *= 0.7
if size_as is not None:
width, height = tensor2pil(size_as).size
text_table = []
@@ -92,12 +92,12 @@ class TextImage:
for j in range(0, len(lines[i])):
offset = int((char_size + line_random[j]) * variation_range / 250)
offset = int(offset * scale / 100)
font_size = char_size - spacing + line_random[j]
font_size = char_size + line_random[j]
font_size = int(font_size * scale / 100)
if font_size < 4:
font_size = 4
axis_x = _x + offset if random.random() > 0.5 else _x - offset
axis_y = _y + offset if random.random() > 0.5 else _y - offset
axis_x = _x + offset // 3 if random.random() > 0.5 else _x - offset // 3
axis_y = _y + offset // 3 if random.random() > 0.5 else _y - offset // 3
char_dict = {'char':lines[i][j],
'axis':(axis_x, axis_y),
'size':font_size}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 890 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

File diff suppressed because it is too large Load Diff