app:
  description: 即梦AI绘画,本工作流主要用到了jimeng-free-api 逆向即梦AI 在线画图功能，通过http请求方式实现即梦AI绘画
  icon: 🤖
  icon_background: '#FFEAD5'
  mode: workflow
  name: 即梦AI绘画
  use_icon_as_answer_icon: false
kind: app
version: 0.1.5
workflow:
  conversation_variables: []
  environment_variables:
  - description: ''
    id: afa5c448-1ec3-432b-8f14-c8f602c0ab5d
    name: jimengsessionid
    selector:
    - env
    - jimengsessionid
    value: xxxxxx
    value_type: string
  features:
    file_upload:
      allowed_file_extensions:
      - .JPG
      - .JPEG
      - .PNG
      - .GIF
      - .WEBP
      - .SVG
      allowed_file_types:
      - image
      allowed_file_upload_methods:
      - local_file
      - remote_url
      enabled: false
      fileUploadConfig:
        audio_file_size_limit: 50
        batch_count_limit: 5
        file_size_limit: 15
        image_file_size_limit: 10
        video_file_size_limit: 100
        workflow_file_upload_limit: 10
      image:
        enabled: false
        number_limits: 3
        transfer_methods:
        - local_file
        - remote_url
      number_limits: 3
    opening_statement: ''
    retriever_resource:
      enabled: true
    sensitive_word_avoidance:
      enabled: false
    speech_to_text:
      enabled: false
    suggested_questions: []
    suggested_questions_after_answer:
      enabled: false
    text_to_speech:
      enabled: false
      language: ''
      voice: ''
  graph:
    edges:
    - data:
        isInIteration: false
        sourceType: start
        targetType: http-request
      id: 1738651659789-source-1738651665284-target
      source: '1738651659789'
      sourceHandle: source
      target: '1738651665284'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: http-request
        targetType: code
      id: 1738651665284-source-1738651805602-target
      source: '1738651665284'
      sourceHandle: source
      target: '1738651805602'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: code
        targetType: end
      id: 1738651805602-source-1738651831615-target
      source: '1738651805602'
      sourceHandle: source
      target: '1738651831615'
      targetHandle: target
      type: custom
      zIndex: 0
    nodes:
    - data:
        desc: ''
        selected: false
        title: 开始
        type: start
        variables:
        - label: 提示词
          max_length: 256
          options: []
          required: true
          type: text-input
          variable: prompt
      height: 90
      id: '1738651659789'
      position:
        x: 96
        y: 282
      positionAbsolute:
        x: 96
        y: 282
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        authorization:
          config: null
          type: no-auth
        body:
          data:
          - id: key-value-1
            key: ''
            type: text
            value: '{

              "model":"jimeng-2.1",

              "prompt":"{{#1738651659789.prompt#}}",

              "negativePrompt":"",

              "width":1024,

              "height":1024,

              "sample_strength":0.5

              }'
          type: json
        desc: ''
        headers: Authorization:Bearer {{#env.jimengsessionid#}}
        method: post
        params: ''
        retry_config:
          max_retries: 3
          retry_enabled: true
          retry_interval: 100
        selected: false
        timeout:
          max_connect_timeout: 0
          max_read_timeout: 0
          max_write_timeout: 0
        title: HTTP 请求
        type: http-request
        url: https://jimeng.duckcloud.fun/v1/images/generations
        variables: []
      height: 136
      id: '1738651665284'
      position:
        x: 384
        y: 282
      positionAbsolute:
        x: 384
        y: 282
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        code: "def main(arg1: str) -> str:\n    import json\n\n    # 解析输入的 JSON 数据\n\
          \    try:\n        data = json.loads(arg1)\n    except json.JSONDecodeError:\n\
          \        return \"输入的字符串不是有效的 JSON 格式，请检查输入数据。\"\n\n    # 确保解析后的数据包含 'data'\
          \ 键\n    if not isinstance(data, dict) or 'data' not in data:\n        return\
          \ \"输入的数据格式不正确，请确保输入是一个包含 'data' 键的 JSON 对象。\"\n\n    # 获取 'data' 键对应的数组数据\n\
          \    image_data = data.get('data', [])\n\n    # 确保 'data' 键的值是一个列表\n   \
          \ if not isinstance(image_data, list):\n        return \"输入的数据中 'data' 键的值不是一个数组，请确保其值是一个\
          \ JSON 数组对象。\"\n\n    # 初始化结果字符串\n    markdown_result = \"\"\n\n    # 遍历每条图片数据\n\
          \    for index, item in enumerate(image_data, start=1):\n        # 检查每条数据是否是字典，并且包含\
          \ 'url' 字段\n        if not isinstance(item, dict) or 'url' not in item:\n\
          \            markdown_result += f\"图片第{index}条内容：无法提取 URL（缺少 'url' 字段）\\\
          n\"\n            continue\n\n        # 提取 URL 并生成 Markdown 格式的图片链接\n   \
          \     url = item['url']\n        markdown_result += f\"![图片{index}]({url})\\\
          n\"\n\n    # 返回最终的 Markdown 字符串\n    return {\"result\": markdown_result}"
        code_language: python3
        desc: ''
        outputs:
          result:
            children: null
            type: string
        selected: false
        title: 代码执行
        type: code
        variables:
        - value_selector:
          - '1738651665284'
          - body
          variable: arg1
      height: 54
      id: '1738651805602'
      position:
        x: 688
        y: 282
      positionAbsolute:
        x: 688
        y: 282
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        desc: ''
        outputs:
        - value_selector:
          - '1738651805602'
          - result
          variable: imageout
        selected: false
        title: 结束
        type: end
      height: 90
      id: '1738651831615'
      position:
        x: 992
        y: 282
      positionAbsolute:
        x: 992
        y: 282
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        author: 周辉
        desc: ''
        height: 124
        selected: false
        showAuthor: true
        text: '{"root":{"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"本工作流主要是使用开源","type":"text","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"jimeng-free-api","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"link","version":1,"rel":null,"target":null,"title":null,"url":"https://github.com/LLM-Red-Team/jimeng-free-api"},{"detail":0,"format":0,"mode":"normal","style":"","text":"项目实现即梦AI逆向API
          通过http请求整合实现dify工作流上即梦AI绘画功能","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1,"textFormat":0}],"direction":"ltr","format":"","indent":0,"type":"root","version":1}}'
        theme: blue
        title: ''
        type: ''
        width: 286
      height: 124
      id: '1738658448946'
      position:
        x: 96
        y: 438.8385301969082
      positionAbsolute:
        x: 96
        y: 438.8385301969082
      selected: true
      sourcePosition: right
      targetPosition: left
      type: custom-note
      width: 286
    viewport:
      x: -12.807763299068597
      y: -120.09309774650524
      zoom: 1.1486983549970349
