Skip to content
ComfyDeploy

Virtual Try-On with Nano Banana

Upload a photo of a person and a garment, add a prompt, and Gemini 2.5 Flash Image generates the person wearing it in the scene you describe.

Virtual Try-On with Nano Banana example output

How it works

The subject and garment images each pass through a ResizeAndPadImage node, which pads them to the aspect ratio you pick. A ResolutionSelector sets the size, and ImageBatch combines the two pictures into one input for the model.

A prompt chain from the llm-toolkit package, using PrimitiveStringMultiline and LLMPromptManager, wraps your text. The ConfigGenerateImageOpenRouter and APIProviderSelectorNode nodes point the GenerateImage node at OpenRouter with your key and the Gemini image model. It returns the finished picture, and SaveImage stores it.

Because the model runs through an API, the workflow does not load any local weights.

Tips

  • Crop and format your subject image to the aspect ratio you choose, since the image is padded rather than stretched.
  • Use a clear garment photo on a plain background.
  • The prompt can also set the scene, for example placing the person in a rustic cafe with warm light.
  • Use the n input to request more than one image per run and pick the best.

Run it as an API

You can deploy this workflow on ComfyDeploy as a hosted API endpoint. The inputs listed above become the request fields, so your own app can submit them and receive the finished result without running ComfyUI yourself. The same workflow can also be run and shared from the ComfyDeploy playground in your browser.

What you can use it for

  • Fashion product try-on previews
  • Showing a dress in a lifestyle setting
  • Quick catalog mockups
  • Testing outfits on a model photo

Run it in three steps

  1. Open the template

    Click Run on ComfyDeploy. The workflow, its custom nodes and models are set up for you on a cloud machine.

  2. Add your inputs

    Provide subject image and garment image in the playground or the ComfyUI editor.

  3. Run, share or deploy

    Run it on a cloud machine, share it with your team as a playground, or deploy it as an API endpoint.

Frequently asked questions

What GPU does this try-on workflow need?

None. It is set to CPU because the image is generated by Gemini through OpenRouter, so no local GPU model runs.

Which model does it use?

google/gemini-2.5-flash-image-preview, with a free variant available in the model dropdown.

Do I need an API key?

Yes. Enter your key in the external_api_key input, or set it as a machine secret, as the input notes describe.

Related workflows

All Nano Banana workflows