Skip to content

how to use foocus with gradio client api #2613

Answered by t1hq
ishangrotra asked this question in Q&A
Discussion options

You must be logged in to vote

so i'm not the only one :), I'm suffering this issue for a week, and then founded, I'm not python expert so I thought this might not be that hard.
the key api in focus 2.3.0 is fn 40, and fn 41:

  • 40 sets all kinds of params
  • 41 makes fooocus to draw

first call 40, then 41, done.

client = Client("http://127.0.0.1:7865/")
result = client.predict(
	...
	fn_index=40
)
print(result)
result= client.predict(fn_index=41)

set params according to values in UI, not in sample.
a demo code is posted here, hopes chinese is not a problem.

Replies: 2 comments 11 replies

Comment options

You must be logged in to vote
8 replies
@dentro-innovation
Comment options

@dinasenpai
Comment options

@dentro-innovation
Comment options

@t1hq
Comment options

@dinasenpai
Comment options

Answer selected by mashb1t
Comment options

You must be logged in to vote
3 replies
@ishangrotra
Comment options

@saibabu10
Comment options

@mashb1t
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants