From PIL import Image, ImageDraw, ImageFont # Crear una nueva imagen en blanco
![from PIL import Image, ImageDraw, ImageFont
# Crear una nueva imagen en blanco (600x800 pixels)
width, height = 600, 800
background_color = (255, 255, 255) # blanco
image = Image.new("RGB", (width, height), background_color)
# Crear un objeto para dibujar
draw = ImageDraw.Draw(image)
# Cargar una fuente
try:
# Try to load a TTF font if font is available_path = "/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf"
font_title = ImageFont.truetype(font_path, 50)
font_text = ImageFont.truetype(font_path, 30)
font_footer = ImageFont.truetype(font_path, 24)
except IOError:
# Fuente por defecto si no se encuentra la TTF
font_title = ImageFont.load_default()
font_text = ImageFont.load_default()
font_footer = ImageFont.load_default()
# Add a blue rectangle at the top for the title draw.rectangle([0, 0, width, 200], fill=(30, 144, 255))
# Add title text title_text = "Happy Father's Day"
draw.text((width/2, 100), title_text, fill="white", font=font_title, anchor="mm")
# Add restaurant text restaurant_text = "Te desea el Restaurante MamaJuana"
draw.text((width/2, 400), restaurant_text, fill="black", font=font_text, anchor="mm")
# Add a blue rectangle at the bottom for the draw footer.rectangle([0, height - 100, width, height], fill=(30, 144, 255))
# Add footer text footer_text = "Let's celebrate together!"
draw.text((width/2, height - 50), footer_text, fill="white", font=font_footer, anchor="mm")
# Guardar la imagen
image.save("/mnt/data/flyer_dia_del_padre.png")](https://image.cdn2.seaart.me/2024-06-16/cpnfkdle878c73atcaeg-1/8db1d199fc04d04a2002e10a6e2aa283_high.webp)
Generation Data
Records
Prompts
Copy
from PIL import Image
,
ImageDraw
,
ImageFont
# Crear una nueva imagen en blanco (600x800 pixels)
width
,
height = 600
,
800
background_color = (255
,
255
,
255) # blanco
image = Image
.
new("RGB"
,
(width
,
height)
,
background_color)
# Crear un objeto para dibujar
draw = ImageDraw
.
Draw(image)
# Cargar una fuente
try:
# Try to load a TTF font if font is available_path = "/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold
.
ttf"
font_title = ImageFont
.
truetype(font_path
,
50)
font_text = ImageFont
.
truetype(font_path
,
30)
font_footer = ImageFont
.
truetype(font_path
,
24)
except IOError:
# Fuente por defecto si no se encuentra la TTF
font_title = ImageFont
.
load_default()
font_text = ImageFont
.
load_default()
font_footer = ImageFont
.
load_default()
# Add a blue rectangle at the top for the title draw
.
rectangle([0
,
0
,
width
,
200]
,
fill=(30
,
144
,
255))
# Add title text title_text = "Happy Father'
;
s Day"
draw
.
text((width/2
,
100)
,
title_text
,
fill="white"
,
font=font_title
,
anchor="mm")
# Add restaurant text restaurant_text = "Te desea el Restaurante MamaJuana"
draw
.
text((width/2
,
400)
,
restaurant_text
,
fill="black"
,
font=font_text
,
anchor="mm")
# Add a blue rectangle at the bottom for the draw footer
.
rectangle([0
,
height - 100
,
width
,
height]
,
fill=(30
,
144
,
255))
# Add footer text footer_text = "Let'
;
s celebrate together
!
"
draw
.
text((width/2
,
height - 50)
,
footer_text
,
fill="white"
,
font=font_footer
,
anchor="mm")
# Guardar la imagen
image
.
save("/mnt/data/flyer_dia_del_padre
.
png")
INFO
Checkpoint & LoRA

Checkpoint
Animagine XL V3.1
#Pixel
0 comment
0
0
0