Help with copying models into automatic docker #248
-
Hello! Thanks for the amazing work! I have been trying for a few hours, and read everything I could find online, but I have been unable to figure out how to actually copy the model to the docker image. I tried putting the model next to the dockerfile and adding this:
Any insight would be amazing! I need to have this happen on the docker side of things so the model is there every time it starts |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 8 replies
-
@astralmedia what you have done is correct, however, I override the folders in the docker compose: and then mount the files to the entrypoint: stable-diffusion-webui-docker/services/AUTOMATIC1111/entrypoint.sh Lines 22 to 38 in 8df9d10 if you want to put all models in the container (note: it will be huge!!!), you can try the following: please note that this method has a lot of limitations and you will lose a lot of flexibility. Run the app at least once to make sure the files in the Copy the Add the following line
exactly here at line 84 after the copy : stable-diffusion-webui-docker/services/AUTOMATIC1111/Dockerfile Lines 83 to 85 in 8df9d10 and then run cd service/AUTOMATIC1111
docker build -t standalone-auto . Note: it will take a lot of time and will use a lot of memory, so be careful! you can now run your image directly, there is a lot of config that has to be done manually, which is why we use docker compose, but the command could look like this:
I have not tried any of this, but I think it should work. |
Beta Was this translation helpful? Give feedback.
-
Why would you like to copy model into image? This seems like a some misconception behind this decision. |
Beta Was this translation helpful? Give feedback.
-
Ok, I am seeing what you mean....Seeing as I want to dockerize the automatic repo, you think I could Frankenstein the two dockers together and just have the automatic dockerfile download and prep those files on build? Thanks for the feedback btw! Seems like its working so far. |
Beta Was this translation helpful? Give feedback.
-
Hey guys, I am pretty close here! When I run the image with however, using this at the end of my dockerfile is not working:
I set the workdir at the start, copy & install everything, then try to run the webui.sh or webui.bat and it says "not found" every time for the bat or sh file. I can run the python webui.py file, but it doesnt set everything up properly. Thanks for any feedback! |
Beta Was this translation helpful? Give feedback.
-
So you are the one from reddit? :) If you are happy with how this repo works, then simply create clean instance. Let docker build image. Let it run and try different options in webui, as some of them are downloading additional dependencies on first execution. Later, when you are happy with all stuff just create your own image from running container with |
Beta Was this translation helpful? Give feedback.
So you are the one from reddit? :)
If you are happy with how this repo works, then simply create clean instance. Let docker build image. Let it run and try different options in webui, as some of them are downloading additional dependencies on first execution.
Later, when you are happy with all stuff just create your own image from running container with
docker commit
. This will export your running container with everything in it as another image.Now it is only a matter of new Dockerfile starting
FROM yourfancyimagename
and use COPY commands to copy models and other mounted directories into specific locations. And viola... big blob image that you can distribute it for friends / colleagues…