Wrapping the FLUX Painting API into a Dify Workflow

Trae

This article focuses on wrapping the publicly available flux1 drawing API (https://img.kdjingpai.com/) into a Dify workflow.

This is a test address, you can refer to this article to deploy the service yourself:White whoring FLUX1 interface shut down, resulting in a major traffic loss on this site... Well, figuring out how to deploy FLUX1 API for free

Rapid deployment source code: https://github.com/pptt121212/freefluxapi

 

1. Building workflows

Create a new "flux1 Workflow" under "Chat Assistant -> Workflow Organizer":

将FLUX绘画API封装为Dify工作流

In total, 3 nodes are used: start, HTTP request and direct reply. Remember the timeout settings if you timeout while debugging. Of these, the HTTP Request node is set as follows:

将FLUX绘画API封装为Dify工作流

The output of the direct reply node is files:Array[File] (a list of files) in the HTTP request node output variable:

将FLUX绘画API封装为Dify工作流

2. Test workflow

At this point the workflow is constructed, draw a picture to try. Set the prompt to: A whimsical arrangement of pink roses, pastel tulips, and baby's breath in a vintage watering can, ideal for a garden party. (A whimsical arrangement of pink roses, pastel tulips, and baby's breath in a vintage watering can, ideal for a garden party.)

将FLUX绘画API封装为Dify工作流将FLUX绘画API封装为Dify工作流

Note: When testing, I found that for the Chinese cue word is very crotch pulling, for the English cue word is poor, right.

© Copyright notes
AiPPT

Related posts

No comments

none
No comments...