Skip to content

Conversation

@eliteprox
Copy link
Collaborator

@eliteprox eliteprox commented Aug 4, 2025

This pull request modernizes and streamlines the example code for the PyTrickle project, introducing a new async processor demo, updating supporting infrastructure, and removing outdated or redundant examples. The main focus is on providing a more advanced, async-capable example (async_processor_example.py) with clean error handling, real-time parameter control, and orchestrator registration, while also updating the development workflow and project exports.

New Example and Supporting Infrastructure

  • Added a new example: async_processor_example.py, which demonstrates an advanced, async frame processor that applies an Accent Green color tint, supports real-time intensity adjustment, error handling, and optional orchestrator registration. This example is now the primary demo for async processing.
  • Added a corresponding Dockerfile (Dockerfile.async_processor_example) for the new async processor example, enabling easy containerized deployment with CUDA support and all necessary dependencies.
  • Added a VSCode launch configuration (.vscode/launch.json) for quickly running and debugging the new async processor example with appropriate environment variables.

Project and Example Cleanup

  • Removed the old simple_stream_processing.py and http_server_example.py examples, which are now superseded by the new async processor demo. [1] [2]
  • Updated the Makefile to run the new async processor example by default for the run-example target.

Library Exports and API Improvements

  • Updated pytrickle/__init__.py to export new and relevant components (such as FrameProcessor, RegisterCapability, FPSMeter, and management classes), and removed the deprecated create_app export, aligning the public API with the new async example and modern usage patterns.

@eliteprox eliteprox marked this pull request as ready for review August 4, 2025 21:36
@eliteprox
Copy link
Collaborator Author

@ad-astra-video This refactor moves the pydantic models for requests to start streams, update params, list streams, get version, (basic) capabilities and health checks. There's also a mess of av frame / tensor conversion methods that were needed in comfystream trickle integration which should be useful for other builders

@eliteprox eliteprox force-pushed the feat/add-api-spec-utils branch from c9e1b64 to 18cfe62 Compare August 4, 2025 23:39
@eliteprox eliteprox changed the base branch from feat/pass-audio-frames to main August 4, 2025 23:39
self.health_manager = health_manager

@abstractmethod
async def create_stream_handler(self, request_id: str, **kwargs) -> Optional[StreamHandler]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not seeing why we need this. I was thinking a stream would look the same from a trickle protocol perspective for all streams.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've had success with moving a ton of generic error handling logic for stream processing in #9. I'm going to try building an app from these changes. @ad-astra-video lmk if you think we should go include this

@eliteprox eliteprox force-pushed the feat/add-api-spec-utils branch from 73fb24a to 75d3a96 Compare August 12, 2025 22:07
@eliteprox eliteprox changed the title add health manager and stream utils methods feat: BYOC StreamServer, FrameProcessor with example app Aug 13, 2025
Copy link
Contributor

@ad-astra-video ad-astra-video left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reviewed and tested locally. I observed passthrough audio and video transformation using the example processor.

Some small refinements may be needed as we push this with pipeline building.

The StreamServer api makes it really easy to get a pipeline onboarded to the network!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants