-
Notifications
You must be signed in to change notification settings - Fork 3.6k
workflow: refactor InferenceClient endpoints logic #13683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 9 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
725eb63
Auto-discover InferenceClient endpoints in gr.Workflow
hannahblair 00ff19a
refactor
hannahblair 3adb980
Merge origin/main into workflow-auto-discovery
hannahblair 9fc6659
format
hannahblair 298843f
lint
hannahblair 7bc16dc
address comments
hannahblair 437ac41
add changeset
gradio-pr-bot 4095841
format
hannahblair 82365d5
Merge branch 'workflow-auto-discovery' of github.com:gradio-app/gradi…
hannahblair 9d59006
revert
hannahblair cdaaf47
fix test
hannahblair 67138f8
add vision model chat workflow
hannahblair f3f0e2a
Merge branch 'main' into workflow-auto-discovery
hannahblair File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "@gradio/workflowcanvas": minor | ||
| "gradio": minor | ||
| --- | ||
|
|
||
| feat:workflow: refactor InferenceClient endpoints logic |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| {"schema_version":"2","name":"Marketing Image Creator","runtime":{"default":"client"},"references":[{"label":"Text","inputs":[{"id":"in","label":"Text","type":"text"}],"outputs":[{"id":"out","label":"Text","type":"text"}],"width":220,"height":163,"asset_type":"text","role":"reference","id":"1539a1e9-4906-4008-b345-e6d05bb69b22","x":740,"y":80,"data":{"in":null}},{"label":"Image","inputs":[{"id":"in","label":"Image","type":"image"}],"outputs":[{"id":"out","label":"Image","type":"image"}],"width":220,"height":124,"asset_type":"image","role":"reference","id":"13e92b22-7173-416c-81c6-1ca097a2a299","x":80,"y":80,"data":{}}],"operators":[{"id":"n_flux","label":"Generate Image","inputs":[{"id":"in","label":"Prompt","type":"text","required":true}],"outputs":[{"id":"out","label":"Image","type":"image"}],"data":{"out":97500097},"x":1040,"y":80,"width":220,"height":124,"role":"operator","kind":"space","source":"hf://spaces/multimodalart/FLUX.1-merged","space_id":"multimodalart/FLUX.1-merged","runtime":"client","endpoints":[{"name":"/infer","inputs":[{"id":"in_0","label":"Prompt","type":"text","required":true},{"id":"in_1","label":"Seed","type":"number","required":false},{"id":"in_2","label":"Randomize seed","type":"boolean","required":false},{"id":"in_3","label":"Width","type":"number","required":false},{"id":"in_4","label":"Height","type":"number","required":false},{"id":"in_5","label":"Guidance Scale","type":"number","required":false},{"id":"in_6","label":"Number of inference steps","type":"number","required":false}],"outputs":[{"id":"out_0","label":"Result","type":"image","output_index":0},{"id":"out_1","label":"Seed","type":"number","output_index":1}]}]},{"label":"Image To Prompt","inputs":[{"id":"in_0","label":"Input Image","type":"image","required":true}],"outputs":[{"id":"out_0","label":"Output Prompt","type":"text","output_index":0}],"width":280,"height":124,"kind":"space","space_id":"ovi054/image-to-prompt","endpoint":"/predict","endpoints":[{"name":"/predict","inputs":[{"id":"in_0","label":"Input Image","type":"image","required":true}],"outputs":[{"id":"out_0","label":"Output Prompt","type":"text","output_index":0}]}],"pipeline_tag":"Image Captioning","role":"operator","id":"897592dc-17b5-473b-9e89-4ebdae4073d6","x":380,"y":80,"data":{}}],"subjects":[{"id":"n_output","label":"Marketing Image","inputs":[{"id":"in","label":"Image","type":"image"}],"outputs":[{"id":"out","label":"Image","type":"image"}],"data":{"in":null},"x":1340,"y":80,"width":220,"height":107,"role":"subject","asset_type":"image"}],"edges":[{"id":"e4","from_node_id":"n_flux","from_port_id":"out","to_node_id":"n_output","to_port_id":"in","type":"image"},{"from_node_id":"1539a1e9-4906-4008-b345-e6d05bb69b22","from_port_id":"out","to_node_id":"n_flux","to_port_id":"in","type":"text","id":"b44e83fe-23b1-4dcc-83d3-55b3481721bc"},{"from_node_id":"13e92b22-7173-416c-81c6-1ca097a2a299","from_port_id":"out","to_node_id":"897592dc-17b5-473b-9e89-4ebdae4073d6","to_port_id":"in_0","type":"image","id":"22796709-ff7d-4250-92c0-2d541f9e6a99"},{"from_node_id":"897592dc-17b5-473b-9e89-4ebdae4073d6","from_port_id":"out_0","to_node_id":"1539a1e9-4906-4008-b345-e6d05bb69b22","to_port_id":"in","type":"text","id":"96dab823-0f2c-4356-98c4-aa82feca5e0a"}],"view":{"default":"canvas"}} | ||
| {"schema_version":"2","name":"Marketing Image Creator","runtime":{"default":"client"},"references":[{"label":"Text","inputs":[{"id":"in","label":"Text","type":"text"}],"outputs":[{"id":"out","label":"Text","type":"text"}],"width":220,"height":163,"asset_type":"text","role":"reference","id":"1539a1e9-4906-4008-b345-e6d05bb69b22","x":740,"y":80,"data":{"in":""}},{"label":"Image","inputs":[{"id":"in","label":"Image","type":"image"}],"outputs":[{"id":"out","label":"Image","type":"image"}],"width":220,"height":124,"asset_type":"image","role":"reference","id":"13e92b22-7173-416c-81c6-1ca097a2a299","x":80,"y":80,"data":{}}],"operators":[{"id":"n_flux","label":"Generate Image","inputs":[{"id":"in","label":"Prompt","type":"text","required":true}],"outputs":[{"id":"out","label":"Image","type":"image"}],"data":{"out":97500097},"x":1040,"y":80,"width":220,"height":136,"role":"operator","kind":"space","source":"hf://spaces/multimodalart/FLUX.1-merged","space_id":"multimodalart/FLUX.1-merged","runtime":"client"},{"label":"Image To Prompt","inputs":[{"id":"in_0","label":"Input Image","type":"image","required":true}],"outputs":[{"id":"out_0","label":"Output Prompt","type":"text","output_index":0}],"width":280,"height":136,"kind":"space","space_id":"ovi054/image-to-prompt","endpoint":"/predict","pipeline_tag":"Image Captioning","role":"operator","id":"897592dc-17b5-473b-9e89-4ebdae4073d6","x":380,"y":80,"data":{}},{"label":"FLUX.1-schnell","inputs":[{"id":"prompt","label":"Prompt","type":"text","required":true},{"id":"negative_prompt","label":"Negative Prompt","type":"text","required":false},{"id":"height","label":"Height","type":"number","required":false},{"id":"width","label":"Width","type":"number","required":false},{"id":"num_inference_steps","label":"Num Inference Steps","type":"number","required":false},{"id":"guidance_scale","label":"Guidance Scale","type":"number","required":false},{"id":"scheduler","label":"Scheduler","type":"text","required":false},{"id":"seed","label":"Seed","type":"number","required":false},{"id":"strength","label":"Strength","type":"number","required":false,"custom":true},{"id":"poop","label":"Poop","type":"number","required":false,"custom":true},{"id":"test","label":"Test","type":"text","required":false,"custom":true}],"outputs":[{"id":"out_0","label":"Image","type":"image","output_index":0}],"width":280,"height":296,"kind":"model","model_id":"black-forest-labs/FLUX.1-schnell","endpoint":"text_to_image","pipeline_tag":"text-to-image","role":"operator","id":"df1ecd1b-99d8-452b-9473-0d88e027d5e0","x":448.99779502371075,"y":295.99779502371075,"data":{"in_0":"a red cube on a blue background","strength":0.42,"poop":3,"height":2,"prompt":"a red cube","out_0":{"name":"output","url":"/gradio_api/file=/var/folders/v0/6c949qls4kdcbbrb5ncdmbqm0000gn/T/hf_workflow_750d12d1dfd737a8.png","mime":"application/octet-stream"}}}],"subjects":[{"id":"n_output","label":"Marketing Image","inputs":[{"id":"in","label":"Image","type":"image"}],"outputs":[{"id":"out","label":"Image","type":"image"}],"data":{"in":null},"x":1340,"y":80,"width":220,"height":107,"role":"subject","asset_type":"image"}],"edges":[{"id":"e4","from_node_id":"n_flux","from_port_id":"out","to_node_id":"n_output","to_port_id":"in","type":"image"},{"from_node_id":"1539a1e9-4906-4008-b345-e6d05bb69b22","from_port_id":"out","to_node_id":"n_flux","to_port_id":"in","type":"text","id":"b44e83fe-23b1-4dcc-83d3-55b3481721bc"},{"from_node_id":"13e92b22-7173-416c-81c6-1ca097a2a299","from_port_id":"out","to_node_id":"897592dc-17b5-473b-9e89-4ebdae4073d6","to_port_id":"in_0","type":"image","id":"22796709-ff7d-4250-92c0-2d541f9e6a99"},{"from_node_id":"897592dc-17b5-473b-9e89-4ebdae4073d6","from_port_id":"out_0","to_node_id":"1539a1e9-4906-4008-b345-e6d05bb69b22","to_port_id":"in","type":"text","id":"96dab823-0f2c-4356-98c4-aa82feca5e0a"}],"view":{"default":"canvas"}} | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.