Skip to content
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

BUG: Symbolic Link gets wipe out #12

Closed
barepixels opened this issue Aug 19, 2023 · 30 comments
Closed

BUG: Symbolic Link gets wipe out #12

barepixels opened this issue Aug 19, 2023 · 30 comments

Comments

@barepixels
Copy link

barepixels commented Aug 19, 2023

Got symbolic links working (thanks) but whenever Fooocus update, it deletes symbolic links and replace with actual folders and starts download missing safetensors. Link to Symbolic Link tutorial https://youtu.be/RDH5IuyPJtk

My current solution is hard code modules/path.py

Before
modelfile_path = os.path.abspath(os.path.join(os.path.dirname(file), '../models/checkpoints/'))
lorafile_path = os.path.abspath(os.path.join(os.path.dirname(file), '../models/loras/'))

After
modelfile_path = os.path.abspath(os.path.join(os.path.dirname(file), 'D:\stable-diffusion-shared\Ckpt\XL'))
lorafile_path = os.path.abspath(os.path.join(os.path.dirname(file), 'D:\stable-diffusion-shared\Lora\SDXL'))

@barepixels
Copy link
Author

barepixels commented Aug 19, 2023

Another time symbolic link get wiped out is when Fooocus crash hard.

I try to generate without using Refinner. I was testing
Fooocus crash
I closed the CMD window and browser tab
Relaunch the run-moonride.bat
Fooocus delete the Symbolic links (checkpoints and loras) created new folders and begins to download the safetensors

@MoonRide303
Copy link
Owner

MoonRide303 commented Aug 19, 2023

@barepixels You're right, it seems git sees symlinks as changes. Please try with directory junctions, like that:

mklink /j D:\Fooocus\models\checkpoints E:\models\sdxl-checkpoints

PS If you don't mind old school Norton Commander style UI (I am old, I know 😂), you can use Far Manager - it makes creating links a bit easier (by simply pressing Alt-F6, and then selecting link type).

@barepixels
Copy link
Author

Will report back

@barepixels
Copy link
Author

/j also get wipe out like /d

@MoonRide303
Copy link
Owner

MoonRide303 commented Aug 19, 2023

@barepixels Strange - junctions worked for me. I am out for the weekend, but we can back to this later on, like check results step by step, after each command.

@barepixels
Copy link
Author

barepixels commented Aug 19, 2023

it work for me too ... till I had a crash ... upon relaunch symlinks were gone. similar to /d

I redo symlinks, it's working now again. will let you know if it happens again

@barepixels
Copy link
Author

After seeing

xiaoyoucheng mentioned this issue 17 hours ago
fix AttributeError: 'NoneType' object has no attribute 'clip' #13 Merged
@MoonRide303 MoonRide303 closed this as completed in #13 8 hours ago

I decided to quit Fooocus MRE CMD window and relaunch

BAMM

symlinks with /J gone. Fooocus MRE replaced symlinks with folders and starts to download safetensors

@MoonRide303
Copy link
Owner

MoonRide303 commented Aug 21, 2023

@barepixels: I did simple test, like that:
image

then changed branches (between main and moonride-main) and launched Fooocus few times (via python .\launch.py from Anaconda PowerShell) and it works fine - git status remains clear, and content of that directory remains unchanged.

I also use hardlinks for single files for a long time (those are limited to single drive) created with Far Manager (allows to do things like hardlinks for 100 files in few seconds), and never had any issues with those, either.

Could you post exact commands you used, and also information how do you launch Fooocus?

@barepixels
Copy link
Author

mklink /J E:\Fooocus_win64_1-1-10\Fooocus-MoonRide\models\checkpoints D:\stable-diffusion-shared\Ckpt\XL

mklink /J E:\Fooocus_win64_1-1-10\Fooocus-MoonRide\models\loras D:\stable-diffusion-shared\Lora\SDXL

then I launch run-moonride.bat
which is locate at: E:\Fooocus_win64_1-1-10/run-moonride.bat

@MoonRide303
Copy link
Owner

@barepixels Could you provide content of that run-moonride.bat file? I don't have it in my repository.

@barepixels
Copy link
Author

barepixels commented Aug 21, 2023

.\python_embeded\python.exe -s Fooocus-MoonRide\entry_with_update.py
pause

From this instruction #1

Should I be using launch.py in Fooocus-MoonRide folder?

@MoonRide303
Copy link
Owner

@barepixels As Anaconda user I never needed to use standalone Python. I will take a look at that distribution from original Fooocus, and see how it works - and then if I can reproduce this issue.

@barepixels
Copy link
Author

barepixels commented Aug 21, 2023

I appreciate your help. Is it that hard or time-consuming to just add the paths to setting.json?

Wish list:

modelfile_path =
lorafile_path =
temp_outputs_path =
able to set default style to "none" or my preferred choice of style

BTW other have symlinks problem too: lllyasviel#161

@MoonRide303
Copy link
Owner

MoonRide303 commented Aug 21, 2023

@barepixels I guess you might be right - for most normal users it would be probably much easier to simply setup the paths via settings file rather than having to struggle with mklink, or wondering why those links are getting destroyed. I'll do it this way.

As for parameters related to generating images I was thinking about having another json with default prompt parameters - stuff like default style would go there, then.

@MoonRide303
Copy link
Owner

MoonRide303 commented Aug 21, 2023

@barepixels Done (customizing paths), available on moonride-main - let me know if works for you.

@barepixels
Copy link
Author

barepixels commented Aug 21, 2023

Confirm, paths.json works.

TIP for some people:
must write with / such as "D:/stable-diffusion-shared/Ckpt/XL"
Windows \ such as "D:\stable-diffusion-shared\Ckpt\XL" will not work.

THANK YOU

@MoonRide303
Copy link
Owner

Okay, closing then - btw. I've just enhanced settings.json - you can now customize default style, and also many other settings :).

@hzeasy
Copy link

hzeasy commented Sep 12, 2023

Confirm, paths.json works.

TIP for some people: must write with / such as "D:/stable-diffusion-shared/Ckpt/XL" Windows \ such as "D:\stable-diffusion-shared\Ckpt\XL" will not work.

THANK YOU

@barepixels Sorry to bother you. Looking for this information made me very happy, but when I tried to operate it, it couldn't achieve the effect. Modifying the folder location according to the prompts you mentioned didn't work. I don't know how to achieve the goal after repeated modifications (please refer to the attached file), please guide me! Thank you!
paths-example -json.txt

@MoonRide303
Copy link
Owner

@hzeasy Please make sure that:

  1. File name is exactly "paths.json" (you might need to enable showing file extensions in Windows).
  2. Paths don't contain unwanted space (like in this example of yours).

Content of sample working customized paths.json file:

{
    "path_checkpoints": "D:/tools/Fooocus/models/checkpoints/",
    "path_loras": "D:/tools/Fooocus/models/loras/",
    "path_embeddings": "D:/tools/Fooocus/models/embeddings/",
    "path_clip_vision": "D:/tools/Fooocus/models/clip_vision/",
    "path_controlnet": "D:/tools/Fooocus/models/controlnet/",
    "path_styles": "../sdxl_styles/",
    "path_outputs": "../outputs/"
}

@hzeasy
Copy link

hzeasy commented Sep 13, 2023

@MoonRide303 Thank you for your help. The path issue has been resolved because I have been keeping the original paths example. json and changing it to paths. json will work fine. However, I have encountered other issues during runtime recently, but there is no need to resolve them in a timely manner. I would like to wait for you to update the MRE before trying again. Thank you!

@hzeasy
Copy link

hzeasy commented Sep 15, 2023

@hzeasy Please make sure that:

  1. File name is exactly "paths.json" (you might need to enable showing file extensions in Windows).
  2. Paths don't contain unwanted space (like in this example of yours).

Content of sample working customized paths.json file:

{
    "path_checkpoints": "D:/tools/Fooocus/models/checkpoints/",
    "path_loras": "D:/tools/Fooocus/models/loras/",
    "path_embeddings": "D:/tools/Fooocus/models/embeddings/",
    "path_clip_vision": "D:/tools/Fooocus/models/clip_vision/",
    "path_controlnet": "D:/tools/Fooocus/models/controlnet/",
    "path_styles": "../sdxl_styles/",
    "path_outputs": "../outputs/"
}

@MoonRide303 Hello, the previous issue has been resolved, but a new fault has been introduced: click“ 📔 Current Log 📔 The 'Previous Log' will display a 'detail': 'File not found:./outputs/2023-09-16/log. html.' This prompt is known to be caused by a change in the path, but I am not sure where to fix it. If possible, please let me know. Thank you.
image

@MoonRide303
Copy link
Owner

@hzeasy Did you generate any images on that machine (current / previous day)? Those links need existing log files to work, and those files are created when you're generating images on given machine.

@hzeasy
Copy link

hzeasy commented Sep 16, 2023

@MoonRide303 Yes, the image was output at the specified path normally, and the log.html file is also available, but it cannot be called in the UI.
image
image

@MoonRide303
Copy link
Owner

@hzeasy You're right, custom outputs path wasn't properly handled when generating links to log files - I've just fixed (commit a922734) - it should work fine when you update to latest version.

@hzeasy
Copy link

hzeasy commented Sep 17, 2023

@MoonRide303 The path issue has been resolved after updating to version 2.0.19, including some other minor issues. And I also found that the Control-LoRA in CN has changed to a folding option. If it's to make room for adding more LORA control functions? If it's true, that would be great! I think the advantage of using MRE lies in its control, and even in version 1.0, I made a video introducing MRE and promoted it on Bilibili. Thank you for your MRE upgrade work. Wishing you success in your work!

@MoonRide303
Copy link
Owner

@hzeasy Yeah, I will be looking into either more CNs / Control-LoRAs, and/or IP-Adapters - but I'd need to make sure it's easy to use and providing high quality results, first (like Canny and Depth, or Revision workflow, which are working pretty well - but it's not so obvious for other models / workflows like Recolor).

@hzeasy
Copy link

hzeasy commented Sep 17, 2023

@hzeasy Yeah, I will be looking into either more CNs / Control-LoRAs, and/or IP-Adapters - but I'd need to make sure it's easy to use and providing high quality results, first (like Canny and Depth, or Revision workflow, which are working pretty well - but it's not so obvious for other models / workflows like Recolor).

@MoonRide303 oh! That's really worth looking forward to. It shouldn't be easy to implement them. IP-Adapters is indeed a very good feature, but please keep fooocus' optimized performance, because currently my 3060-6G graphics card can use CN very well, even if I combine Canny and There is no problem if Depth is started at the same time..

@MoonRide303
Copy link
Owner

MoonRide303 commented Sep 17, 2023

@hzeasy Today I will need to fix some bugs - it seems all that VM code from vanilla wasn't compatible with current Comfy, and newer MRE versions (after v2.0.14) don't work on lower end machines (when trying to use refiner).

Update: fixed in v2.0.19 (disabled that VM from vanilla, that was causing problems when used with new Comfy - and it's not really needed with new Comfy, which automates most of the model memory management).

@hzeasy
Copy link

hzeasy commented Sep 18, 2023

Update: fixed in v2.0.19 (disabled that VM from vanilla, that was causing problems when used with new Comfy - and it's not really needed with new Comfy, which automates most of the model memory management).

@MoonRide303 I'm so excited to share what you're doing. I'm a layman on programming codes, so I usually can only turn to ChatGPT, haha. I tested lllyasviel version 2.0.62 today and encountered a GPU memory problem after simply taking out 3 pictures.This situation occasionally occurred in previous MRE versions, and I think it should be optimized.I asked lllyasviel this question。
Then I ran it on MRE with the same parameters. At the same time, the three pictures came out very quickly, but I noticed a warning. I had not seen this before, but it did not affect the picture output.
d7f0bedb313101190f14c833f0c1b14

image

@barepixels
Copy link
Author

barepixels commented Sep 18, 2023

@lllyasviel I get the same errors using the latest vanilla Fooocus 2.0.62
two pictures came out very quickly, but I noticed a warning. I had not seen this before, but it did not affect the picture output.

error

UPDATE: It seem to go away. No longer have the errors. Wondering what changes did I made.
UPDATE: It seem to came back on relaunch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants