Skip to content

This is part of a project (mobile application) that provides the ability to take pictures with a smartphone camera and use them in the ComfyUI workflow

License

Notifications You must be signed in to change notification settings

numq/camera-capture

Repository files navigation

Camera Capture

🌟 Support this project
Bitcoin (BTC) bc1qs6qq0fkqqhp4whwq8u8zc5egprakvqxewr5pmx
Ethereum (ETH) 0x3147bEE3179Df0f6a0852044BFe3C59086072e12
USDT (TRC-20) TKznmR65yhPt5qmYCML4tNSWFeeUkgYSEV

This is a project that provides the ability to take pictures with a smartphone camera and use them in the ComfyUI workflow

The project consists of two parts:
ComfyUI node and mobile application 📍

preview

Note

The application was designed using the Reduce & Conquer architectural pattern

📖 Table of Content

📱 Supported platforms

Platform Minimal Version Availability
Android 8.0 (SDK 28)
iOS -

✨ Features

Android

  • Configure port (default: 8090)
  • Turn flashlight on/off
  • Switch camera lens facing

ComfyUI node:

  • Configure port (default: 8090)
  • Configure timeout (default: 10 seconds)
  • Get output as image, width, height

🔧 How does it work?

Android

The application consists of two parts: a camera for capturing images and an HTTP server. When a request is received, the server captures an image from the camera and returns it in JSON format.

ComfyUI node

The node performs port forwarding using adb, which allows you to connect to the server on your USB-connected smartphone via localhost. When the node is executed, an HTTP client is created that sends a request to the server running on the smartphone and then receives a response with a JSON file containing the image, its width and height.

📦 Installation

Install adb on your computer. Make sure it is set in environment variables and can be called in command line

Android

Install the Camera Capture application, which allows you to capture images from your smartphone camera

ComfyUI node

Clone comfyui-camera-capture-node repository into your ./ComfyUI/custom_nodes folder, or download the latest release and place the comfyui-camera-capture-node folder there

🎯 Usage

Important

Make sure the port of the client and server match

Android

  1. Connect your smartphone to your PC via USB
  2. Launch the Camera Capture application
  3. Grant permission to use the smartphone camera
  4. If you see a preview of the camera, it is working
  5. Change the port if necessary
  6. Establish a connection to the server, making sure that it has a Connected state

ComfyUI node

  1. Find the category camera
  2. Add a node Camera Capture to the workflow
  3. Run the workflow
  4. If you get a black 512x512 image, check the console for an error

🔗 Links

About

This is part of a project (mobile application) that provides the ability to take pictures with a smartphone camera and use them in the ComfyUI workflow

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages