Nodes/comfyui-cyc-email/cyc email/邮件发送 (SMTP)
ComfyUI Node

cyc email/邮件发送 (SMTP)

Get an Email When ComfyUI Is Done, Instead of Watching the Terminal

By 532777032·Created 2 months ago·Updated 2 months ago· 10
cyc email/邮件发送 (SMTP)
  • 图像
  • 任意
    公众号:程序员野区true
    SMTP服务器smtp.qq.com
    端口587
    使用SSLfalse
    发件邮箱
    授权码
    收件邮箱
    主题ComfyUI 生成完成
    正文您的图片已生成,详见附件。

    You queued a 300-image batch, went to make coffee, came back, and it finished forty minutes ago - but only because the fan noise gave it away. If you'd rather the render email you instead, this is the node for it. SendEmailNode from the tiny comfyui_cyc_email pack is an end-of-workflow node that mails whatever image you hand it to any inbox, using plain old SMTP. No API key, no webhook service, no Discord bot to babysit. Just your email provider's servers.

    It shows up in the node menu as cyc email/邮件发送 (SMTP) (the pack is Chinese-made, so the UI labels are mostly Chinese) and it's an output node: no outputs at all, you wire it to the very end of the graph and it fires like Save Image does.

    How it actually works

    The mechanism is worth knowing because it has a real consequence. The node overrides IS_CHANGED to return random.random() - the classic "always rerun" trick from ComfyUI's plumbing layer. A random value never equals the last run's, so the engine can't cache it and executes it every single time you hit Queue. That means you get one email per run, no exceptions. Iterating seeds with this node wired in? You'll spam your own inbox. Treat it as a "load this workflow, set up the run, walk away" node - not something you leave in the graph while tuning prompts.

    When it runs, it takes the first image in the batch (图像/IMAGE), converts the tensor to a PNG in memory, and attaches it as image.png. One honest gotcha straight from the source: only 图像[0] gets attached. Generate a batch of six and you'll get the first one, not a contact sheet. The email itself is a plain multipart message - subject, multi-line body, PNG attachment - sent over TLS 1.2+ (which QQ's mail servers require), with a 30-second timeout and two automatic retries with backoff if the first attempt fails.

    The inputs that matter

    There are nine required fields but you really only touch four, plus the two optional sockets:

    • SMTP服务器 (smtp.qq.com) and 端口 - defaults are QQ-focused, but you can point it at Gmail, Outlook, or any provider's SMTP.
    • 使用SSL - check it for port 465 (SSL), leave it unchecked for port 587 (STARTTLS). Get this pairing wrong and the connection just fails.
    • 授权码 - the one that trips everyone up. This is a 16-character authorization code generated in QQ's mail settings, not your account password. Generate it once, paste it, done.
    • 发件邮箱 / 收件邮箱 / 主题 / 正文 - sender, recipient, and the default subject/body ("ComfyUI 生成完成" / "Your image is generated, see attachment") are fine to keep.

    That Boolean labeled 公众号:程序员野区 is the author promoting their WeChat account. It does absolutely nothing - pure self-promotion in the widget list. Flip it either way.

    The optional 图像 socket is the attachment; 任意 is a *-typed wire that exists only to force a trigger - it isn't processed at all.

    Installing it

    Install via ComfyUI Manager (search "comfyui_cyc_email"), or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/532777032/comfyui_cyc_email
    

    Then restart ComfyUI. That's the entire install - the README's claim of "no external dependencies" holds up: it uses only Python's stdlib (smtplib, email, ssl) plus numpy/Pillow, which ComfyUI already ships. No model files, no pip packages, no API keys.

    Troubleshooting

    The author's own debug print is a decent checklist, and the big one is first: don't run this behind a third-party proxy or VPN. The README screams it in caps (不要走第三方代理或者 VPN!) - SMTP connections to smtp.qq.com routinely die or hang through proxies. If you're getting timeouts and you run any kind of proxy, that's your first suspect, not your mail settings.

    Beyond that: auth failures (535) mean the authorization code is wrong or you're using your real password; connection refused means the port is blocked on your network or you've mismatched 465/587 with the SSL toggle. And since the retry logic prints ✅ 邮件发送成功 / ❌ 邮件发送最终失败 to the console, the server log is where you'll see exactly what died. Finally, the example workflow ships with a note that basically says "put it at the end, but only once the workflow runs clean" - if an upstream node errors, the mail never fires, so don't rely on it as a crash alert.

    CategorycycNode

    Inputs (11)

    NameTypeDefaultDescription
    公众号:程序员野区BOOLEANtrue如有遇到使用上的问题,可以前往公众号留言。
    SMTP服务器STRINGsmtp.qq.comQQ邮箱的SMTP服务器地址
    端口INT5871–65535推荐587(TLS)或465(SSL)
    使用SSLBOOLEANfalse端口465时勾选(SSL),端口587时取消勾选(TLS)
    发件邮箱STRING完整的QQ邮箱地址
    授权码STRINGQQ邮箱授权码(16位字母数字)
    收件邮箱STRING目标邮箱地址
    主题STRINGComfyUI 生成完成邮件主题
    正文STRING您的图片已生成,详见附件。邮件正文,支持多行文本
    图像optIMAGE要作为附件发送的图片(可选)
    任意opt*任意输入(仅用于触发,实际不处理)

    Outputs (0)

    No outputs