mrhan1993 / Fooocus-API

FastAPI powered API for Fooocus
GNU General Public License v3.0
508 stars 135 forks source link

Support for Fooocus 2.3.0 or 2.3.1 ? #259

Closed miraculix95 closed 3 months ago

miraculix95 commented 3 months ago

Hello, I have seen that Fooocus 2.3.0 has come out a couple of days ago, so I now tried to update. Why: Because, I have seen that Fooocus has become more efficient, and I was able to run a checkpoint and a refiner on the Fooocus UI with my computer.

Now, updating my Fooocus-API: I was running into some troubles with that. And I am extremely confused.

What I was trying was to do a "git pull origin main" in my Fooocos-API/repositories/Fooocus folder this gave me an update to 2.3.1 but my script was not working anymore

after a reboot to also update my running Fooocus-API I saw that the version had reverted to 2.1.86 next step, I updated Fooocus with "git pull origin main" in my Fooocos-API/repositories/Fooocus folder

and I also updated my Fooocus-API to 0.3.30 with "git pull origin main" in my Fooocos-API folder

reboot, now I seem to have kept the new versions, but the test script (a minimal text-to-image prompt) just returns nothing.

I have not seen any comments on all these topics. Sorry. Can anyone help?

miraculix95 commented 3 months ago

looking at the logs, I get this error, even though I have a safetensor in my checkpoints and I hand it over with: "base_model_name": "juggernautXL_v8Rundiffusion.safetensors" in the script

Mar 23 22:04:39 pst9hxxwlbdr python3[817]: Import default pipeline error: No such file or directory: "/home/paperspace/Fooocus-API/repositories/Fooocus/models/checkpoints/model.safetensors"

miraculix95 commented 3 months ago

the script (without all the imports):

def prepare_api_request():

    # API Payload befüllen
    data = {
        "prompt": "tree", 
        "negative_prompt": "",
        # "base_model_name": "juggernautXL_v9Rdphoto2Lightning.safetensors",
        "base_model_name": "juggernautXL_v8Rundiffusion.safetensors",
        "advanced_params": {},
        # "image_prompts": [],
    }
    return data

def main():
    # URL der FastAPI Endpoints - auswählen
    print("\n\nStarting main programm ...", "\n")
    # url = "http://localhost:8888/v2/generation/image-prompt"
    url = "http://localhost:8888/v1/generation/text-to-image"

    data = prepare_api_request()

    for key, value in data.items():
        print(key, ":", value)
    response = requests.post(url, json=data)

    print("\n" * 2)
    print("------------------ Result --------------------")
    print("Image-creation Response: ", response.text, "\n")

# Start the main programm
if __name__ == "__main__":
    main()
miraculix95 commented 3 months ago

I also got these errors in my logs [Warning] Wrong base_model_name input: juggernautXL_v8Rundiffusion.safetensors, using default Import default pipeline error: No such file or directory: "/home/paperspace/Fooocus-API/repositories/Fooocus/models/checkpoints/model.safetensors"

piyushgit011 commented 3 months ago

257 same error , if you find any fix , let me know

woodytang commented 3 months ago

Import default pipeline error: No such file or directory: "/media/ts/ssd/Fooocus-API/repositories/Fooocus/models/checkpoints/model.safetensors"

mrhan1993 commented 3 months ago

@piyushgit011 @miraculix95 @woodytang copy presets folder in fooocus to fooocusapi root

miraculix95 commented 3 months ago

@mrhan1993 doing the copy, restarting the Fooocus-API service ... now it works :)) thanks so much!

miraculix95 commented 3 months ago

@mrhan1993 maybe, can you give some explanation on the update process in general, if the apis capture all the new features, what is planned, please? So that I understand better

and thanks for the great work!!!

mrhan1993 commented 3 months ago

@mrhan1993 maybe, can you give some explanation on the update process in general, if the apis capture all the new features, what is planned, please? So that I understand better

and thanks for the great work!!!

Due to family reasons, it may take half a month to continue this work. sorry

sajjadafridi commented 3 months ago

looking at the logs, I get this error, even though I have a safetensor in my checkpoints and I hand it over with: "base_model_name": "juggernautXL_v8Rundiffusion.safetensors" in the script

Mar 23 22:04:39 pst9hxxwlbdr python3[817]: Import default pipeline error: No such file or directory: "/home/paperspace/Fooocus-API/repositories/Fooocus/models/checkpoints/model.safetensors"

You can define a default model in the :

config.txt file
"default_model": "realisticStockPhoto_v10.safetensors",