Over the past few months, The Weeknd — aka Abel Tesfaye — has found multiple ways to expand his persona. He’s dropped his smash “After Hours” album, which brought forth a new vulnerability in its lyrics and made a cameo appearance (as himself) in Adam Sandler’s film “Uncut Gems.” But at the other end of the spectrum, he made comic turns on “Saturday Night Live” and in a guest spot on TBS’ long-running animated series “American Dad,” which saw him not only writing a song and voicing his character (a literally virginal version of himself) but also helping to write the episode, which was called, naturally, “A Starboy Is Born.”

“I’m a longtime fan of the show,” he said. “I’ve been watching since high school, but I really appreciated it about seven years ago. It’s been running for so long, and I feel like it has a real cult following. To really enjoy the show in its entirety you have to really know the characters.”

The show presents a comic twist on The Weeknd image — as did his appearance in a classic “SNL” song-skit with Kenan Thompson and Chris Redd called “On the Couch,” a mock R&B ballad about being banished by the wife.

The Weeknd spoke with us about “American Dad” when the episode aired in May, but as Emmy season gets rolling, we connected with him again, along with the show’s writer-producer Joel Hurwitz.

How did the script come together? Were you sending it back and forth or was it more brainstorming over the phone?

Hurwitz: I’ve never written a script with a mega-celebrity singer before, so we basically invented our process on the fly. Early on, Abel was in New York recording a No. 1 album or something. So we talked on the phone and texted a lot.

Celebrity cameos are inherently corny, but we wanted “A Starboy Is Born” to be different. The Weeknd and “American Dad” are weirdly aligned in the zeitgeist, so this had the potential to be special. After we wrote the script, I kept Abel in the loop at every boring animation stage. “American Dad” is a team effort and Abel’s involvement fired everyone up.

Abel, “American Dad” showed a humorous side of your personality and persona that hadn’t really been seen before. Was that something you wanted more people to be aware of?

The Weeknd: Yes, because I’ve been doing this for a decade now and everyone thinks I have this dark, shadowy aura. I wanted to show people that I don’t take myself too seriously.

What’s another aspect of your personality or persona that maybe isn’t well known?

The Weeknd: I’m very approachable, and people don’t really know that about me. It might be surprising to some to learn how inquisitive I am and how much I love talking to people and going deep into conversation.

Did the idea for the song come while you were working on the script?

Hurwitz: We thought the original song should play against The Weeknd’s brand. The writers room pitched so many hilarious song ideas. One day in the room, I wrote “Weeknd Is Virgin” on the board. I instantly regretted it. I was crying from laughing so hard, but I still didn’t know Abel that well. I thought it would offend him. Like, asking The Weeknd to call himself a virgin isn’t quirky — it would straight-up damage The Weeknd’s image if the episode sucks. So I didn’t pitch the virgin idea. Then that night, Abel called me and said “Hey, what if I was a virgin?”

The Weeknd: When you hear the song, you understand that it’s specifically for the show. Also a big shout-out to Asa (Taccone, who co-wrote the song and also co-wrote and co-produced Portugal. The Man’s smash “Feel It, Still”), who is a ... genius producer/writer. Definitely will be collaborating with him more in the future.

Abel, what’s your dream episode of a cartoon you’d make, both as a writer and voicing a character?

The Weeknd: Working with (legendary Warner Bros. voice actor) Mel Blanc would have been a dream — getting to play alongside him as Bugs Bunny would have been surreal.