comfyanonymous / ComfyUI_examples

Examples of ComfyUI workflows
https://comfyanonymous.github.io/ComfyUI_examples/
Other
2.03k stars 352 forks source link

Outdated stable audio example #40

Open huchenlei opened 2 months ago

huchenlei commented 2 months ago

https://github.com/comfyanonymous/ComfyUI/commit/fdf37566ef7f636387aa5fc887030e454bf2d836 introduced a new parameter on EmptyLatentAudio but the example workflow has not been updated.

  file: 'audio_stable_audio_example.flac.json',
  workflow: '{"last_node_id": 17, "last_link_id": 26, "nodes": [{"id": 4, "type": "CheckpointLoaderSimple", "pos": [0, 240], "size": {"0": 336, "1": 98}, "flags": {}, "order": 0, "mode": 0, "outputs": [{"name": "MODEL", "type": "MODEL", "links": [18], "slot_index": 0}, {"name": "CLIP", "type": "CLIP", "links": [], "slot_index": 1}, {"name": "VAE", "type": "VAE", "links": [14], "slot_index": 2}], "properties": {"Node name for S&R": "CheckpointLoaderSimple"}, "widgets_values": ["stable_audio_open_1.0.safetensors"]}, {"id": 10, "type": "CLIPLoader", "pos": [0, 96], "size": {"0": 335.6534118652344, "1": 82}, "flags": {}, "order": 1, "mode": 0, "outputs": [{"name": "CLIP", "type": "CLIP", "links": [25, 26], "shape": 3, "slot_index": 0}], "properties": {"Node name for S&R": "CLIPLoader"}, "widgets_values": ["t5_base.safetensors", "stable_audio"]}, {"id": 12, "type": "VAEDecodeAudio", "pos": [1200, 96], "size": {"0": 210, "1": 46}, "flags": {}, "order": 6, "mode": 0, "inputs": [{"name": "samples", "type": "LATENT", "link": 13}, {"name": "vae", "type": "VAE", "link": 14, "slot_index": 1}], "outputs": [{"name": "AUDIO", "type": "AUDIO", "links": [15], "shape": 3, "slot_index": 0}], "properties": {"Node name for S&R": "VAEDecodeAudio"}}, {"id": 11, "type": "EmptyLatentAudio", "pos": [576, 480], "size": {"0": 240, "1": 58}, "flags": {}, "order": 2, "mode": 0, "outputs": [{"name": "LATENT", "type": "LATENT", "links": [12], "shape": 3}], "properties": {"Node name for S&R": "EmptyLatentAudio"}, "widgets_values": [47.6]}, {"id": 7, "type": "CLIPTextEncode", "pos": [384, 288], "size": {"0": 432, "1": 144}, "flags": {}, "order": 4, "mode": 0, "inputs": [{"name": "clip", "type": "CLIP", "link": 26}], "outputs": [{"name": "CONDITIONING", "type": "CONDITIONING", "links": [6], "slot_index": 0}], "properties": {"Node name for S&R": "CLIPTextEncode"}, "widgets_values": [""], "color": "#322", "bgcolor": "#533"}, {"id": 13, "type": "SaveAudio", "pos": [1440, 96], "size": {"0": 355.22216796875, "1": 100}, "flags": {}, "order": 7, "mode": 0, "inputs": [{"name": "audio", "type": "AUDIO", "link": 15}], "properties": {"Node name for S&R": "SaveAudio"}, "widgets_values": ["audio/ComfyUI", null]}, {"id": 3, "type": "KSampler", "pos": [864, 96], "size": {"0": 315, "1": 262}, "flags": {}, "order": 5, "mode": 0, "inputs": [{"name": "model", "type": "MODEL", "link": 18}, {"name": "positive", "type": "CONDITIONING", "link": 4}, {"name": "negative", "type": "CONDITIONING", "link": 6}, {"name": "latent_image", "type": "LATENT", "link": 12, "slot_index": 3}], "outputs": [{"name": "LATENT", "type": "LATENT", "links": [13], "slot_index": 0}], "properties": {"Node name for S&R": "KSampler"}, "widgets_values": [840755638734093, "randomize", 50, 4.98, "dpmpp_3m_sde_gpu", "exponential", 1]}, {"id": 6, "type": "CLIPTextEncode", "pos": [384, 96], "size": {"0": 432, "1": 144}, "flags": {}, "order": 3, "mode": 0, "inputs": [{"name": "clip", "type": "CLIP", "link": 25}], "outputs": [{"name": "CONDITIONING", "type": "CONDITIONING", "links": [4], "slot_index": 0}], "properties": {"Node name for S&R": "CLIPTextEncode"}, "widgets_values": ["heaven church electronic dance music"], "color": "#232", "bgcolor": "#353"}], "links": [[4, 6, 0, 3, 1, "CONDITIONING"], [6, 7, 0, 3, 2, "CONDITIONING"], [12, 11, 0, 3, 3, "LATENT"], [13, 3, 0, 12, 0, "LATENT"], [14, 4, 2, 12, 1, "VAE"], [15, 12, 0, 13, 0, "AUDIO"], [18, 4, 0, 3, 0, "MODEL"], [25, 10, 0, 6, 0, "CLIP"], [26, 10, 0, 7, 0, "CLIP"]], "groups": [], "config": {}, "extra": {"ds": {"scale": 1, "offset": {"0": 697.7777099609375, "1": 426.6668395996094}}}, "version": 0.4}',
  prompt: '{"3": {"inputs": {"seed": 840755638734093, "steps": 50, "cfg": 4.98, "sampler_name": "dpmpp_3m_sde_gpu", "scheduler": "exponential", "denoise": 1.0, "model": ["4", 0], "positive": ["6", 0], "negative": ["7", 0], "latent_image": ["11", 0]}, "class_type": "KSampler"}, "4": {"inputs": {"ckpt_name": "stable_audio_open_1.0.safetensors"}, "class_type": "CheckpointLoaderSimple"}, "6": {"inputs": {"text": "heaven church electronic dance music", "clip": ["10", 0]}, "class_type": "CLIPTextEncode"}, "7": {"inputs": {"text": "", "clip": ["10", 0]}, "class_type": "CLIPTextEncode"}, "10": {"inputs": {"clip_name": "t5_base.safetensors", "type": "stable_audio"}, "class_type": "CLIPLoader"}, "11": {"inputs": {"seconds": 47.6}, "class_type": "EmptyLatentAudio"}, "12": {"inputs": {"samples": ["3", 0], "vae": ["4", 2]}, "class_type": "VAEDecodeAudio"}, "13": {"inputs": {"filename_prefix": "audio/ComfyUI", "audio": ["12", 0]}, "class_type": "SaveAudio"}}',
  parsedWorkflow: [Object],
  skip: false
} › correctly generates prompt json for audio_stable_audio_example.flac.json

    expect(received).toEqual(expected) // deep equality

    - Expected  - 0
    + Received  + 1

    @@ -7,10 +7,11 @@
          },
        },
        "11": Object {
          "class_type": "EmptyLatentAudio",
          "inputs": Object {
    +       "batch_size": 1,
            "seconds": 47.6,
          },
        },
        "12": Object {
          "class_type": "VAEDecodeAudio",

      72 |
      73 |           const output = await app.graphToPrompt()
    > 74 |           expect(output.output).toEqual(fixLegacyPrompt(JSON.parse(prompt)))
         |                                 ^
      75 |         }
      76 |       )
      77 |     }

      at toEqual (tests-ui/tests/exampleWorkflows.test.ts:74:33)
      at tryCatch (tests-ui/tests/exampleWorkflows.test.ts:4:1062)
      at Generator.<anonymous> (tests-ui/tests/exampleWorkflows.test.ts:4:3008)
      at Generator.next (tests-ui/tests/exampleWorkflows.test.ts:4:1699)
      at asyncGeneratorStep (tests-ui/tests/exampleWorkflows.test.ts:5:70)
      at _next (tests-ui/tests/exampleWorkflows.test.ts:6:163)