Fooocus
Fooocus copied to clipboard
i cant make API works ( python on linux )
Can some one paste working code ? code what system give me after i clicking on "Use via API" on the bottom of the page, is useless, and not documented at all.
Please provide more information.
from gradio_client import Client
client = Client("http://127.0.0.1:7865/", serialize=False)
result = client.predict(
"Howdy!", # str in 'parameter_10' Textbox component
"Howdy!", # str in 'Negative Prompt' Textbox component
["Fooocus V2"], # List[str] in 'Selected Styles' Checkboxgroup component
"Speed", # str in 'Performance' Radio component
"1152×896", # <span style='color: grey;'> | 1:2</span>", # str in 'Aspect Ratios' Radio component
1, # int | float (numeric value between 1 and 32)in 'Image Number' Slider component
"123", # str in 'Seed' Textbox component
0, # int | float (numeric value between 0.0 and 30.0)in 'Image Sharpness' Slider component
1, # int | float (numeric value between 1.0 and 30.0)in 'Guidance Scale' Slider component
"juggernautXL_version6Rundiffusion.safetensors", # str (Option from: ['juggernautXL_version6Rundiffusion.safetensors', 'realisticStockPhoto_v10.safetensors', 'bluePencilXL_v050.safetensors', 'DreamShaper_8_pruned.safetensors'])in 'Base Model (SDXL only)' Dropdown component
"None", # str (Option from: ['None', 'juggernautXL_version6Rundiffusion.safetensors', 'realisticStockPhoto_v10.safetensors', 'bluePencilXL_v050.safetensors', 'DreamShaper_8_pruned.safetensors'])in 'Refiner (SDXL or SD 1.5)' Dropdown component
0.1, # int | float (numeric value between 0.1 and 1.0)in 'Refiner Switch At' Slider component
"None", # str (Option from: ['None', 'sd_xl_offset_example-lora_1.0.safetensors', 'SDXL_FILM_PHOTOGRAPHY_STYLE_BetaV0.4.safetensors', 'sdxl_lcm_lora.safetensors'])in 'LoRA 1' Dropdown component
-2, # int | float (numeric value between -2 and 2)in 'Weight' Slider component
"None", # str (Option from: ['None', 'sd_xl_offset_example-lora_1.0.safetensors', 'SDXL_FILM_PHOTOGRAPHY_STYLE_BetaV0.4.safetensors', 'sdxl_lcm_lora.safetensors'])in 'LoRA 2' Dropdown component
-2, # int | float (numeric value between -2 and 2)in 'Weight' Slider component
"None", # str (Option from: ['None', 'sd_xl_offset_example-lora_1.0.safetensors', 'SDXL_FILM_PHOTOGRAPHY_STYLE_BetaV0.4.safetensors', 'sdxl_lcm_lora.safetensors'])in 'LoRA 3' Dropdown component
-2, # int | float (numeric value between -2 and 2)in 'Weight' Slider component
"None", # str (Option from: ['None', 'sd_xl_offset_example-lora_1.0.safetensors', 'SDXL_FILM_PHOTOGRAPHY_STYLE_BetaV0.4.safetensors', 'sdxl_lcm_lora.safetensors'])in 'LoRA 4' Dropdown component
-2, # int | float (numeric value between -2 and 2)in 'Weight' Slider component
"None", # str (Option from: ['None', 'sd_xl_offset_example-lora_1.0.safetensors', 'SDXL_FILM_PHOTOGRAPHY_STYLE_BetaV0.4.safetensors', 'sdxl_lcm_lora.safetensors'])in 'LoRA 5' Dropdown component
-2, # int | float (numeric value between -2 and 2)in 'Weight' Slider component
True, # bool in 'Input Image' Checkbox component
"Howdy!", # str in 'parameter_73' Textbox component
"Disabled", # str in 'Upscale or Variation:' Radio component
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==", # str (filepath or URL to image)in 'Drag above image to here' Image component
["Left"], # List[str] in 'Outpaint Direction' Checkboxgroup component
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==", # str (filepath or URL to image)in 'Drag above image to here' Image component
"Howdy!", # str in 'Inpaint Additional Prompt' Textbox component
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==", # str (filepath or URL to image)in 'Image' Image component
0, # int | float (numeric value between 0.0 and 1.0)in 'Stop At' Slider component
0, # int | float (numeric value between 0.0 and 2.0)in 'Weight' Slider component
"ImagePrompt", # str in 'Type' Radio component
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==", # str (filepath or URL to image)in 'Image' Image component
0, # int | float (numeric value between 0.0 and 1.0)in 'Stop At' Slider component
0, # int | float (numeric value between 0.0 and 2.0)in 'Weight' Slider component
"ImagePrompt", # str in 'Type' Radio component
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==", # str (filepath or URL to image)in 'Image' Image component
0, # int | float (numeric value between 0.0 and 1.0)in 'Stop At' Slider component
0, # int | float (numeric value between 0.0 and 2.0)in 'Weight' Slider component
"ImagePrompt", # str in 'Type' Radio component
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==", # str (filepath or URL to image)in 'Image' Image component
0, # int | float (numeric value between 0.0 and 1.0)in 'Stop At' Slider component
0, # int | float (numeric value between 0.0 and 2.0)in 'Weight' Slider component
"ImagePrompt", # str in 'Type' Radio component
fn_index=29
)
print(result)
its working for me
from gradio_client import Client client = Client("http://127.0.0.1:7865/", serialize=False) result = client.predict( "Howdy!", # str in 'parameter_10' Textbox component "Howdy!", # str in 'Negative Prompt' Textbox component ["Fooocus V2"], # List[str] in 'Selected Styles' Checkboxgroup component "Speed", # str in 'Performance' Radio component "1152×896", # <span style='color: grey;'> | 1:2</span>", # str in 'Aspect Ratios' Radio component 1, # int | float (numeric value between 1 and 32)in 'Image Number' Slider component "123", # str in 'Seed' Textbox component 0, # int | float (numeric value between 0.0 and 30.0)in 'Image Sharpness' Slider component 1, # int | float (numeric value between 1.0 and 30.0)in 'Guidance Scale' Slider component "juggernautXL_version6Rundiffusion.safetensors", # str (Option from: ['juggernautXL_version6Rundiffusion.safetensors', 'realisticStockPhoto_v10.safetensors', 'bluePencilXL_v050.safetensors', 'DreamShaper_8_pruned.safetensors'])in 'Base Model (SDXL only)' Dropdown component "None", # str (Option from: ['None', 'juggernautXL_version6Rundiffusion.safetensors', 'realisticStockPhoto_v10.safetensors', 'bluePencilXL_v050.safetensors', 'DreamShaper_8_pruned.safetensors'])in 'Refiner (SDXL or SD 1.5)' Dropdown component 0.1, # int | float (numeric value between 0.1 and 1.0)in 'Refiner Switch At' Slider component "None", # str (Option from: ['None', 'sd_xl_offset_example-lora_1.0.safetensors', 'SDXL_FILM_PHOTOGRAPHY_STYLE_BetaV0.4.safetensors', 'sdxl_lcm_lora.safetensors'])in 'LoRA 1' Dropdown component -2, # int | float (numeric value between -2 and 2)in 'Weight' Slider component "None", # str (Option from: ['None', 'sd_xl_offset_example-lora_1.0.safetensors', 'SDXL_FILM_PHOTOGRAPHY_STYLE_BetaV0.4.safetensors', 'sdxl_lcm_lora.safetensors'])in 'LoRA 2' Dropdown component -2, # int | float (numeric value between -2 and 2)in 'Weight' Slider component "None", # str (Option from: ['None', 'sd_xl_offset_example-lora_1.0.safetensors', 'SDXL_FILM_PHOTOGRAPHY_STYLE_BetaV0.4.safetensors', 'sdxl_lcm_lora.safetensors'])in 'LoRA 3' Dropdown component -2, # int | float (numeric value between -2 and 2)in 'Weight' Slider component "None", # str (Option from: ['None', 'sd_xl_offset_example-lora_1.0.safetensors', 'SDXL_FILM_PHOTOGRAPHY_STYLE_BetaV0.4.safetensors', 'sdxl_lcm_lora.safetensors'])in 'LoRA 4' Dropdown component -2, # int | float (numeric value between -2 and 2)in 'Weight' Slider component "None", # str (Option from: ['None', 'sd_xl_offset_example-lora_1.0.safetensors', 'SDXL_FILM_PHOTOGRAPHY_STYLE_BetaV0.4.safetensors', 'sdxl_lcm_lora.safetensors'])in 'LoRA 5' Dropdown component -2, # int | float (numeric value between -2 and 2)in 'Weight' Slider component True, # bool in 'Input Image' Checkbox component "Howdy!", # str in 'parameter_73' Textbox component "Disabled", # str in 'Upscale or Variation:' Radio component "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==", # str (filepath or URL to image)in 'Drag above image to here' Image component ["Left"], # List[str] in 'Outpaint Direction' Checkboxgroup component "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==", # str (filepath or URL to image)in 'Drag above image to here' Image component "Howdy!", # str in 'Inpaint Additional Prompt' Textbox component "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==", # str (filepath or URL to image)in 'Image' Image component 0, # int | float (numeric value between 0.0 and 1.0)in 'Stop At' Slider component 0, # int | float (numeric value between 0.0 and 2.0)in 'Weight' Slider component "ImagePrompt", # str in 'Type' Radio component "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==", # str (filepath or URL to image)in 'Image' Image component 0, # int | float (numeric value between 0.0 and 1.0)in 'Stop At' Slider component 0, # int | float (numeric value between 0.0 and 2.0)in 'Weight' Slider component "ImagePrompt", # str in 'Type' Radio component "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==", # str (filepath or URL to image)in 'Image' Image component 0, # int | float (numeric value between 0.0 and 1.0)in 'Stop At' Slider component 0, # int | float (numeric value between 0.0 and 2.0)in 'Weight' Slider component "ImagePrompt", # str in 'Type' Radio component "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==", # str (filepath or URL to image)in 'Image' Image component 0, # int | float (numeric value between 0.0 and 1.0)in 'Stop At' Slider component 0, # int | float (numeric value between 0.0 and 2.0)in 'Weight' Slider component "ImagePrompt", # str in 'Type' Radio component fn_index=29 ) print(result)
its working for me
THANK YOU, it's also working for me , finaly !!!!!!!!!!!
@Novosti1 Thank you for posting the working request. Please consider closing this issue if you have no further questions.
如果不想使用Advanced的功能 参数应该怎么传
trying to run the code above on Windows in PyCharm and I only get the following.. nothing in outputs Loaded as API: http://127.0.0.1:7865/ ✔ ()
Process finished with exit code 0
trying to run the code above on Windows in PyCharm and I only get the following.. nothing in outputs Loaded as API: http://127.0.0.1:7865/ ✔ ()
Process finished with exit code 0
Came here to post this exact comment/question. I had copied the sample code from @DevepNoName and it was working just a few days ago. Today, that same code is returning merely ()
. I see nothing in STDOUT nor in any logs.
This has to do with new features being implemented and thus more parameters needing to be present in the POST request body. Please find the API documentation in the footer of Fooocus. The fn_index might have changed though.
There also is another repository wrapping the Fooocus Gradio API as REST, see https://github.com/konieshadow/Fooocus-API
Relates to https://github.com/lllyasviel/Fooocus/issues/1224
from gradio_client import Client client = Client("http://127.0.0.1:7865/", serialize=False) result = client.predict( "Howdy!", # str in 'parameter_10' Textbox component "Howdy!", # str in 'Negative Prompt' Textbox component ["Fooocus V2"], # List[str] in 'Selected Styles' Checkboxgroup component "Speed", # str in 'Performance' Radio component "1152×896", # <span style='color: grey;'> | 1:2</span>", # str in 'Aspect Ratios' Radio component 1, # int | float (numeric value between 1 and 32)in 'Image Number' Slider component "123", # str in 'Seed' Textbox component 0, # int | float (numeric value between 0.0 and 30.0)in 'Image Sharpness' Slider component 1, # int | float (numeric value between 1.0 and 30.0)in 'Guidance Scale' Slider component "juggernautXL_version6Rundiffusion.safetensors", # str (Option from: ['juggernautXL_version6Rundiffusion.safetensors', 'realisticStockPhoto_v10.safetensors', 'bluePencilXL_v050.safetensors', 'DreamShaper_8_pruned.safetensors'])in 'Base Model (SDXL only)' Dropdown component "None", # str (Option from: ['None', 'juggernautXL_version6Rundiffusion.safetensors', 'realisticStockPhoto_v10.safetensors', 'bluePencilXL_v050.safetensors', 'DreamShaper_8_pruned.safetensors'])in 'Refiner (SDXL or SD 1.5)' Dropdown component 0.1, # int | float (numeric value between 0.1 and 1.0)in 'Refiner Switch At' Slider component "None", # str (Option from: ['None', 'sd_xl_offset_example-lora_1.0.safetensors', 'SDXL_FILM_PHOTOGRAPHY_STYLE_BetaV0.4.safetensors', 'sdxl_lcm_lora.safetensors'])in 'LoRA 1' Dropdown component -2, # int | float (numeric value between -2 and 2)in 'Weight' Slider component "None", # str (Option from: ['None', 'sd_xl_offset_example-lora_1.0.safetensors', 'SDXL_FILM_PHOTOGRAPHY_STYLE_BetaV0.4.safetensors', 'sdxl_lcm_lora.safetensors'])in 'LoRA 2' Dropdown component -2, # int | float (numeric value between -2 and 2)in 'Weight' Slider component "None", # str (Option from: ['None', 'sd_xl_offset_example-lora_1.0.safetensors', 'SDXL_FILM_PHOTOGRAPHY_STYLE_BetaV0.4.safetensors', 'sdxl_lcm_lora.safetensors'])in 'LoRA 3' Dropdown component -2, # int | float (numeric value between -2 and 2)in 'Weight' Slider component "None", # str (Option from: ['None', 'sd_xl_offset_example-lora_1.0.safetensors', 'SDXL_FILM_PHOTOGRAPHY_STYLE_BetaV0.4.safetensors', 'sdxl_lcm_lora.safetensors'])in 'LoRA 4' Dropdown component -2, # int | float (numeric value between -2 and 2)in 'Weight' Slider component "None", # str (Option from: ['None', 'sd_xl_offset_example-lora_1.0.safetensors', 'SDXL_FILM_PHOTOGRAPHY_STYLE_BetaV0.4.safetensors', 'sdxl_lcm_lora.safetensors'])in 'LoRA 5' Dropdown component -2, # int | float (numeric value between -2 and 2)in 'Weight' Slider component True, # bool in 'Input Image' Checkbox component "Howdy!", # str in 'parameter_73' Textbox component "Disabled", # str in 'Upscale or Variation:' Radio component "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==", # str (filepath or URL to image)in 'Drag above image to here' Image component ["Left"], # List[str] in 'Outpaint Direction' Checkboxgroup component "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==", # str (filepath or URL to image)in 'Drag above image to here' Image component "Howdy!", # str in 'Inpaint Additional Prompt' Textbox component "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==", # str (filepath or URL to image)in 'Image' Image component 0, # int | float (numeric value between 0.0 and 1.0)in 'Stop At' Slider component 0, # int | float (numeric value between 0.0 and 2.0)in 'Weight' Slider component "ImagePrompt", # str in 'Type' Radio component "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==", # str (filepath or URL to image)in 'Image' Image component 0, # int | float (numeric value between 0.0 and 1.0)in 'Stop At' Slider component 0, # int | float (numeric value between 0.0 and 2.0)in 'Weight' Slider component "ImagePrompt", # str in 'Type' Radio component "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==", # str (filepath or URL to image)in 'Image' Image component 0, # int | float (numeric value between 0.0 and 1.0)in 'Stop At' Slider component 0, # int | float (numeric value between 0.0 and 2.0)in 'Weight' Slider component "ImagePrompt", # str in 'Type' Radio component "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==", # str (filepath or URL to image)in 'Image' Image component 0, # int | float (numeric value between 0.0 and 1.0)in 'Stop At' Slider component 0, # int | float (numeric value between 0.0 and 2.0)in 'Weight' Slider component "ImagePrompt", # str in 'Type' Radio component fn_index=29 ) print(result)
its working for me
i try to change fn_indext to 30 and it give me this result. how i can preview/show the image result?
({'visible': False, 'type': 'update'}, {'visible': False, 'type': 'update'}, {'visible': False, 'type': 'update'}, {'visible': True, 'value': [{'name': '/tmp/gradio/91fb36fbf1b291c4c1e05ab3d1716bfe70bb8b8a/image.png', 'data': None, 'is_file': True}], 'type': 'update'})
does it also work for CoLab?
from gradio_client import Client client = Client("http://127.0.0.1:7865/", serialize=False) result = client.predict( "Howdy!", # str in 'parameter_10' Textbox component "Howdy!", # str in 'Negative Prompt' Textbox component ["Fooocus V2"], # List[str] in 'Selected Styles' Checkboxgroup component "Speed", # str in 'Performance' Radio component "1152×896", # <span style='color: grey;'> | 1:2</span>", # str in 'Aspect Ratios' Radio component 1, # int | float (numeric value between 1 and 32)in 'Image Number' Slider component "123", # str in 'Seed' Textbox component 0, # int | float (numeric value between 0.0 and 30.0)in 'Image Sharpness' Slider component 1, # int | float (numeric value between 1.0 and 30.0)in 'Guidance Scale' Slider component "juggernautXL_version6Rundiffusion.safetensors", # str (Option from: ['juggernautXL_version6Rundiffusion.safetensors', 'realisticStockPhoto_v10.safetensors', 'bluePencilXL_v050.safetensors', 'DreamShaper_8_pruned.safetensors'])in 'Base Model (SDXL only)' Dropdown component "None", # str (Option from: ['None', 'juggernautXL_version6Rundiffusion.safetensors', 'realisticStockPhoto_v10.safetensors', 'bluePencilXL_v050.safetensors', 'DreamShaper_8_pruned.safetensors'])in 'Refiner (SDXL or SD 1.5)' Dropdown component 0.1, # int | float (numeric value between 0.1 and 1.0)in 'Refiner Switch At' Slider component "None", # str (Option from: ['None', 'sd_xl_offset_example-lora_1.0.safetensors', 'SDXL_FILM_PHOTOGRAPHY_STYLE_BetaV0.4.safetensors', 'sdxl_lcm_lora.safetensors'])in 'LoRA 1' Dropdown component -2, # int | float (numeric value between -2 and 2)in 'Weight' Slider component "None", # str (Option from: ['None', 'sd_xl_offset_example-lora_1.0.safetensors', 'SDXL_FILM_PHOTOGRAPHY_STYLE_BetaV0.4.safetensors', 'sdxl_lcm_lora.safetensors'])in 'LoRA 2' Dropdown component -2, # int | float (numeric value between -2 and 2)in 'Weight' Slider component "None", # str (Option from: ['None', 'sd_xl_offset_example-lora_1.0.safetensors', 'SDXL_FILM_PHOTOGRAPHY_STYLE_BetaV0.4.safetensors', 'sdxl_lcm_lora.safetensors'])in 'LoRA 3' Dropdown component -2, # int | float (numeric value between -2 and 2)in 'Weight' Slider component "None", # str (Option from: ['None', 'sd_xl_offset_example-lora_1.0.safetensors', 'SDXL_FILM_PHOTOGRAPHY_STYLE_BetaV0.4.safetensors', 'sdxl_lcm_lora.safetensors'])in 'LoRA 4' Dropdown component -2, # int | float (numeric value between -2 and 2)in 'Weight' Slider component "None", # str (Option from: ['None', 'sd_xl_offset_example-lora_1.0.safetensors', 'SDXL_FILM_PHOTOGRAPHY_STYLE_BetaV0.4.safetensors', 'sdxl_lcm_lora.safetensors'])in 'LoRA 5' Dropdown component -2, # int | float (numeric value between -2 and 2)in 'Weight' Slider component True, # bool in 'Input Image' Checkbox component "Howdy!", # str in 'parameter_73' Textbox component "Disabled", # str in 'Upscale or Variation:' Radio component "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==", # str (filepath or URL to image)in 'Drag above image to here' Image component ["Left"], # List[str] in 'Outpaint Direction' Checkboxgroup component "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==", # str (filepath or URL to image)in 'Drag above image to here' Image component "Howdy!", # str in 'Inpaint Additional Prompt' Textbox component "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==", # str (filepath or URL to image)in 'Image' Image component 0, # int | float (numeric value between 0.0 and 1.0)in 'Stop At' Slider component 0, # int | float (numeric value between 0.0 and 2.0)in 'Weight' Slider component "ImagePrompt", # str in 'Type' Radio component "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==", # str (filepath or URL to image)in 'Image' Image component 0, # int | float (numeric value between 0.0 and 1.0)in 'Stop At' Slider component 0, # int | float (numeric value between 0.0 and 2.0)in 'Weight' Slider component "ImagePrompt", # str in 'Type' Radio component "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==", # str (filepath or URL to image)in 'Image' Image component 0, # int | float (numeric value between 0.0 and 1.0)in 'Stop At' Slider component 0, # int | float (numeric value between 0.0 and 2.0)in 'Weight' Slider component "ImagePrompt", # str in 'Type' Radio component "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==", # str (filepath or URL to image)in 'Image' Image component 0, # int | float (numeric value between 0.0 and 1.0)in 'Stop At' Slider component 0, # int | float (numeric value between 0.0 and 2.0)in 'Weight' Slider component "ImagePrompt", # str in 'Type' Radio component fn_index=29 ) print(result)
its working for me
i try to change fn_indext to 30 and it give me this result. how i can preview/show the image result?
({'visible': False, 'type': 'update'}, {'visible': False, 'type': 'update'}, {'visible': False, 'type': 'update'}, {'visible': True, 'value': [{'name': '/tmp/gradio/91fb36fbf1b291c4c1e05ab3d1716bfe70bb8b8a/image.png', 'data': None, 'is_file': True}], 'type': 'update'})
As what was shown in the returned result, the image was saved in your /tmp folder. See the "/tmp/gradio/91fb36fbf1b291c4c1e05ab3d1716bfe70bb8b8a/image.png"? That is the image.
On Windows, what I did is copy the output image from windows to my specified output folder using the shutil.copy() command.