Views
No views yet
colors = [
(255, 60, 60),
(60, 255, 180),
(120, 120, 255),
(255, 200, 60)
]
for _ in range(30):
x1 = random.randint(0, 512)
y1 = random.randint(0, 512)
x2 = random.randint(0, 512)
y2 = random.randint(0, 512)
draw.line((x1, y1, x2, y2), fill=random.choice(colors), width=3)
draw.text((30, 460), f"Gheeyal X | {mood}", fill=(255, 255, 255))
path = "cover.png"
img.save(path)
return pathprompt = f"""
Mood: {mood}
Create:
1. One powerful rap or song line
2. One Instagram caption
3. One music vibe (lofi, trap, drill, sad, energetic)
Format:
SongLine:
Caption:
MusicVibe:
"""
text = generator(
prompt,
max_length=120,
temperature=0.9,
do_sample=True
)[0]["generated_text"]
result = text.split("Format:")[-1].strip()
# ---------------- Voice ----------------
tts = gTTS(result)
audio_path = "voice.mp3"
tts.save(audio_path)
# ---------------- Image ----------------
image_path = generate_cover(mood)
return result, audio_path, image_path