app:
  description: ''
  icon: 🤖
  icon_background: '#FFEAD5'
  mode: workflow
  name: Wanx - Text-to-Video Demo
  use_icon_as_answer_icon: false
dependencies: []
kind: app
version: 0.3.0
workflow:
  conversation_variables: []
  environment_variables:
  - description: ''
    id: 2da4d60c-33f6-495e-b46d-a12e7d203e2b
    name: DASHSCOPE_API_KEY
    selector:
    - env
    - DASHSCOPE_API_KEY
    value: sk-xxx
    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
        isInLoop: false
        sourceType: start
        targetType: http-request
      id: 1747623729369-source-1747730936834-target
      source: '1747623729369'
      sourceHandle: source
      target: '1747730936834'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        isInLoop: false
        sourceType: http-request
        targetType: code
      id: 1747730936834-source-1747731008171-target
      source: '1747730936834'
      sourceHandle: source
      target: '1747731008171'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        isInLoop: false
        sourceType: http-request
        targetType: code
      id: 1747731041630-source-1747731109908-target
      source: '1747731041630'
      sourceHandle: source
      target: '1747731109908'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        isInLoop: false
        sourceType: code
        targetType: end
      id: 1747731109908-source-1747731145007-target
      source: '1747731109908'
      sourceHandle: source
      target: '1747731145007'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        isInLoop: false
        sourceType: code
        targetType: loop
      id: 1747731008171-source-1747799610305-target
      source: '1747731008171'
      sourceHandle: source
      target: '1747799610305'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        isInLoop: true
        loop_id: '1747799610305'
        sourceType: loop-start
        targetType: code
      id: 1747799610305start-source-1747799617305-target
      source: 1747799610305start
      sourceHandle: source
      target: '1747799617305'
      targetHandle: target
      type: custom
      zIndex: 1002
    - data:
        isInLoop: false
        sourceType: loop
        targetType: http-request
      id: 1747799610305-source-1747731041630-target
      source: '1747799610305'
      sourceHandle: source
      target: '1747731041630'
      targetHandle: target
      type: custom
      zIndex: 0
    nodes:
    - data:
        desc: ''
        selected: false
        title: Start
        type: start
        variables:
        - label: user_input
          max_length: 48
          options: []
          required: true
          type: text-input
          variable: user_input
      height: 90
      id: '1747623729369'
      position:
        x: 30
        y: 287
      positionAbsolute:
        x: 30
        y: 287
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        authorization:
          config: null
          type: no-auth
        body:
          data:
          - id: key-value-97
            key: ''
            type: text
            value: "{\n    \"model\": \"wan2.1-t2v-turbo\",\n    \"input\": {\n \
              \       \"prompt\": \"{{#1747623729369.user_input#}}\"\n    }\n}"
          type: raw-text
        desc: ''
        headers: 'X-DashScope-Async:enable

          Authorization:Bearer {{#env.DASHSCOPE_API_KEY#}}

          Content-Type:application/json'
        method: post
        params: ''
        retry_config:
          max_retries: 3
          retry_enabled: true
          retry_interval: 100
        selected: false
        ssl_verify: true
        timeout:
          max_connect_timeout: 0
          max_read_timeout: 0
          max_write_timeout: 0
        title: step1-Get task-id
        type: http-request
        url: https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis
        variables: []
      height: 171
      id: '1747730936834'
      position:
        x: 334
        y: 287
      positionAbsolute:
        x: 334
        y: 287
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        code: "\ndef main(arg1: str) -> dict:\n    import json\n    import time\n\
          \    task_id = json.loads(arg1)['output']['task_id']\n    return {\n   \
          \     \"result\": task_id,\n    }\n"
        code_language: python3
        desc: ''
        outputs:
          result:
            children: null
            type: string
        retry_config:
          max_retries: 3
          retry_enabled: false
          retry_interval: 1000
        selected: false
        title: step2-Get task-id
        type: code
        variables:
        - value_selector:
          - '1747730936834'
          - body
          variable: arg1
      height: 54
      id: '1747731008171'
      position:
        x: 638
        y: 287
      positionAbsolute:
        x: 638
        y: 287
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        authorization:
          config: null
          type: no-auth
        body:
          data: []
          type: none
        desc: ''
        headers: Authorization:Bearer {{#env.DASHSCOPE_API_KEY#}}
        method: get
        params: ''
        retry_config:
          max_retries: 10
          retry_enabled: true
          retry_interval: 2991
        selected: false
        ssl_verify: true
        timeout:
          max_connect_timeout: 0
          max_read_timeout: 0
          max_write_timeout: 0
        title: step3-Get video URL
        type: http-request
        url: https://dashscope-intl.aliyuncs.com/api/v1/tasks/{{#1747731008171.result#}}
        variables: []
      height: 158
      id: '1747731041630'
      position:
        x: 1667
        y: 287
      positionAbsolute:
        x: 1667
        y: 287
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        code: "\ndef main(arg1: str) -> dict:\n    import json\n    url = json.loads(arg1)['output']['video_url']\n\
          \    return {\n        \"result\": url,\n    }\n"
        code_language: python3
        desc: ''
        outputs:
          result:
            children: null
            type: string
        selected: false
        title: step4-Get video URL
        type: code
        variables:
        - value_selector:
          - '1747731041630'
          - body
          variable: arg1
      height: 54
      id: '1747731109908'
      position:
        x: 1971
        y: 287
      positionAbsolute:
        x: 1971
        y: 287
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        desc: ''
        outputs:
        - value_selector:
          - '1747731109908'
          - result
          variable: show_image
        selected: false
        title: End
        type: end
      height: 90
      id: '1747731145007'
      position:
        x: 2275
        y: 287
      positionAbsolute:
        x: 2275
        y: 287
      selected: true
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        break_conditions:
        - comparison_operator: '='
          id: bd95d915-d03d-4f30-8b11-5535b3095e09
          value: '31'
          varType: number
          variable_selector:
          - '1747799610305'
          - time
        desc: ''
        error_handle_mode: terminated
        height: 174
        logical_operator: and
        loop_count: 31
        loop_variables:
        - id: cc4c9cac-1258-4c81-aea0-de7b7763e6fa
          label: time
          value: '0'
          value_type: constant
          var_type: number
        selected: false
        start_node_id: 1747799610305start
        title: Wait for 5 minutes
        type: loop
        width: 665
      height: 174
      id: '1747799610305'
      position:
        x: 942
        y: 287
      positionAbsolute:
        x: 942
        y: 287
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 665
      zIndex: 1
    - data:
        desc: ''
        isInLoop: true
        selected: false
        title: ''
        type: loop-start
      draggable: false
      height: 48
      id: 1747799610305start
      parentId: '1747799610305'
      position:
        x: 60
        y: 63
      positionAbsolute:
        x: 1002
        y: 350
      selectable: false
      sourcePosition: right
      targetPosition: left
      type: custom-loop-start
      width: 44
      zIndex: 1002
    - data:
        code: "def main():\n    import time\n    time.sleep(10)\n    return {\n  \
          \      \"result\": \"\"\n    }"
        code_language: python3
        desc: ''
        isInIteration: false
        isInLoop: true
        loop_id: '1747799610305'
        outputs:
          result:
            children: null
            type: string
        selected: false
        title: 代码执行 3
        type: code
        variables: []
      height: 54
      id: '1747799617305'
      parentId: '1747799610305'
      position:
        x: 204
        y: 60
      positionAbsolute:
        x: 1146
        y: 347
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
      zIndex: 1002
    viewport:
      x: -388.9999999999999
      y: -10.000000000000057
      zoom: 0.7
