Commit c9be4a9
authored
js & .yml now conform to Gradio queue_api
Mismatched output format - Old '/gradio_api/call/{event_id}' SSE 'complete' event returned data wrapped as '[function_result]'. Gradio 5's queue API 'process_completed' event returns 'function_result' directly (no outer array). Both callers ('result[0]' for markers, 'result.forEach' for tags) expect the wrapper. Caused 'frames.filter is not a function' and 'result.forEach is not a function' on first test.
- Switched '_gradioCall()' to 'POST /gradio_api/queue/join' with 'fn_index' (0 = predict_tags, 1 = predict_markers) + random 'session_hash', SSE stream from '/gradio_api/queue/data'
- Parses 'data:' JSON lines for 'msg: "process_completed"' (Gradio 5 SSE v3 format)
- Wraps result as '[msg.output.data[0]]' to match old callers' expected shape
- Consolidated two URL constants into one 'STASHMARKER_API_BASE'
ONNX Space pins 'gradio>=5.0.0' (no minor lock). On container rebuild (cold start, cache eviction), pip resolves to latest Gradio 5.x. Old '/gradio_api/call/' endpoint was never correct for queue-enabled Gradio 5 it worked during testing due to whatever version/cache state the container had at that time.
Testing the new endpoint returns tags on inputs that would not appear previously, and the accuracy of the returned tags appears anecdotally to be more accurate than the previous non -ONNX endpoint. Also included an Agnets.md file in the event that a user wants to have an agent work with the API directly. this was sourced from [source](https://huggingface.co/spaces/cc1234/stashtag_onnx/agents.md)1 parent 7f0f64a commit c9be4a9
2 files changed
Lines changed: 53 additions & 45 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
| 4 | + | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
2242 | 2241 | | |
2243 | 2242 | | |
2244 | 2243 | | |
2245 | | - | |
| 2244 | + | |
2246 | 2245 | | |
2247 | 2246 | | |
2248 | 2247 | | |
| |||
2544 | 2543 | | |
2545 | 2544 | | |
2546 | 2545 | | |
2547 | | - | |
| 2546 | + | |
2548 | 2547 | | |
2549 | 2548 | | |
2550 | | - | |
| 2549 | + | |
2551 | 2550 | | |
2552 | 2551 | | |
2553 | 2552 | | |
2554 | 2553 | | |
2555 | 2554 | | |
2556 | 2555 | | |
2557 | 2556 | | |
2558 | | - | |
2559 | | - | |
2560 | | - | |
2561 | | - | |
2562 | | - | |
2563 | | - | |
2564 | | - | |
2565 | | - | |
| 2557 | + | |
| 2558 | + | |
| 2559 | + | |
| 2560 | + | |
| 2561 | + | |
| 2562 | + | |
| 2563 | + | |
2566 | 2564 | | |
2567 | | - | |
| 2565 | + | |
2568 | 2566 | | |
2569 | 2567 | | |
2570 | | - | |
| 2568 | + | |
| 2569 | + | |
| 2570 | + | |
| 2571 | + | |
| 2572 | + | |
| 2573 | + | |
| 2574 | + | |
| 2575 | + | |
| 2576 | + | |
2571 | 2577 | | |
2572 | 2578 | | |
2573 | | - | |
2574 | | - | |
| 2579 | + | |
| 2580 | + | |
2575 | 2581 | | |
2576 | 2582 | | |
2577 | | - | |
2578 | | - | |
| 2583 | + | |
2579 | 2584 | | |
2580 | 2585 | | |
2581 | 2586 | | |
| |||
2591 | 2596 | | |
2592 | 2597 | | |
2593 | 2598 | | |
2594 | | - | |
2595 | | - | |
2596 | | - | |
| 2599 | + | |
2597 | 2600 | | |
2598 | | - | |
2599 | | - | |
2600 | | - | |
2601 | | - | |
2602 | | - | |
2603 | | - | |
2604 | | - | |
2605 | | - | |
2606 | | - | |
2607 | | - | |
| 2601 | + | |
| 2602 | + | |
| 2603 | + | |
| 2604 | + | |
| 2605 | + | |
| 2606 | + | |
| 2607 | + | |
| 2608 | + | |
| 2609 | + | |
2608 | 2610 | | |
| 2611 | + | |
| 2612 | + | |
| 2613 | + | |
| 2614 | + | |
| 2615 | + | |
| 2616 | + | |
| 2617 | + | |
| 2618 | + | |
| 2619 | + | |
2609 | 2620 | | |
2610 | | - | |
2611 | | - | |
2612 | | - | |
2613 | | - | |
2614 | | - | |
2615 | 2621 | | |
2616 | 2622 | | |
2617 | 2623 | | |
2618 | | - | |
| 2624 | + | |
| 2625 | + | |
2619 | 2626 | | |
2620 | 2627 | | |
2621 | 2628 | | |
| |||
2645 | 2652 | | |
2646 | 2653 | | |
2647 | 2654 | | |
2648 | | - | |
| 2655 | + | |
2649 | 2656 | | |
2650 | 2657 | | |
2651 | 2658 | | |
| |||
2677 | 2684 | | |
2678 | 2685 | | |
2679 | 2686 | | |
2680 | | - | |
| 2687 | + | |
2681 | 2688 | | |
2682 | 2689 | | |
2683 | 2690 | | |
| |||
3772 | 3779 | | |
3773 | 3780 | | |
3774 | 3781 | | |
3775 | | - | |
| 3782 | + | |
| 3783 | + | |
3776 | 3784 | | |
3777 | 3785 | | |
3778 | 3786 | | |
3779 | | - | |
| 3787 | + | |
3780 | 3788 | | |
3781 | 3789 | | |
3782 | 3790 | | |
| |||
4075 | 4083 | | |
4076 | 4084 | | |
4077 | 4085 | | |
4078 | | - | |
| 4086 | + | |
4079 | 4087 | | |
4080 | 4088 | | |
4081 | 4089 | | |
| |||
4112 | 4120 | | |
4113 | 4121 | | |
4114 | 4122 | | |
4115 | | - | |
| 4123 | + | |
4116 | 4124 | | |
4117 | 4125 | | |
4118 | 4126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
0 commit comments