BennyKok / comfyui-deploy

An open source `vercel` like deployment platform for Comfy UI
https://comfydeploy.ing
GNU Affero General Public License v3.0
769 stars 84 forks source link

fix(create run): ComfyUIDeployExternalText default value was overwritten #22

Closed EmmanuelMr18 closed 5 months ago

EmmanuelMr18 commented 5 months ago

Nodes of type ComfyUIDeployExternalText were overwritten by others of the same type.

In this function, we populate the workflow API with the prompts written by the user (web form). Example:

// web form
const inputs = {
  positive_prompt: "a dog",
  negative_prompt: "blurry"
}
// worflow_api
{
 "1": {
    "inputs": {
      "input_id": "positive_prompt",
      "default_value": "a house"
    },
    "class_type": "ComfyUIDeployExternalText",
  },
  "2": {
    "inputs": {
      "input_id": "negative_prompt",
      "default_value": "watermark"
    },
    "class_type": "ComfyUIDeployExternalText",
  },
}

In this case, at the end, we'll end with something like this because in the second loop iteration (negative_prompt), we are overwriting the 1.inputs.default_value to be "blurry".

{
 "1": {
    "inputs": {
      "input_id": "a dog",
      "default_value": "blury"
    },
    "class_type": "ComfyUIDeployExternalText",
  },
  "2": {
    "inputs": {
      "input_id": "blury",
      "default_value": "blury"
    },
    "class_type": "ComfyUIDeployExternalText",
  },
}
EmmanuelMr18 commented 5 months ago

Watch the live examples:

NicholasKao1029 commented 5 months ago

looks good!