Reducing container file size #20
-
Hey again! I had a follow up question and figured it would make more sense to post here than the original thread... So I was able to get the standalone version working on a runpod serverless endpoint, then I built my own image -> published to docker hub -> and again was able to successfully deploy the custom image to the serverless endpoint. Both are working great and as advertised. No issues on that end! There's just 1 thing that's bothering me a bit and that's the size of my container: It's not much different from the latest standalone release version which is So I was hoping you could answer these 2 questions:
Line 20 in 0b6e049 I know in the comment you say these are all needed but if I am not using many of the features of Fooocus and only need text2img for the obvious purpose and for img2img I am only using the I just don't want to start deleting things cause I suspect Fooocus might still be using some of these models under the hood for the tasks I mentioned even if they aren't immediately clear based on the names. For example I have a feeling that the FaceSwap feature is made possible through segmentation by models like Sorry if this last one is more of a As always much thanks, you've been crazy helpful answering my many many questions haha |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Since container size on its own won't affect its generation speed (the model sizes and resources of course can, but only when they're loaded for a task), the main reason to keep them tiny is your own time needed to upload them online and perhaps waiting for a new workers to download them. But of course, it makes sense to remove models that you're sure you won't need. In fact, they're making most of the image size (currently uncompressed 17.7GB), which is also the reason why the Here's a list of models and when they're used: "juggernautXL_v8Rundiffusion.safetensors (and all /checkpoints models)": "base model",
"sd_xl_offset_example-lora_1.0.safetensors (and your own /loras files)": "base LoRa",
"sdxl_lightning_4step_lora.safetensors": "used for Lighting speed option",
"sdxl_lcm_lora.safetensors": "used for Extreme Speed option",
"fooocus_inpaint_head.pth": "used for inpainting",
"inpaint.fooocus.patch": "used for inpainting",
"inpaint_v25.fooocus.patch": "used for inpainting when inpaint_engine:v2.5",
"inpaint_v26.fooocus.patch": "used for inpainting when inpaint_engine:v2.6",
"control-lora-canny-rank128.safetensors": "used in img2img and txt2imgip when cn_type:PyraCanny",
"fooocus_xl_cpds_128.safetensors": "used in img2img and txt2imgip when cn_type:CPDS",
"fooocus_ip_negative.safetensors": "when mixing image prompt and vary upscale, mixing image prompt and inpaint or face"
"ip-adapter-plus_sdxl_vit-h.bin": "when mixing image prompt and vary upscale, mixing image prompt and inpaint",
"ip-adapter-plus-face_sdxl_vit-h.bin": "used for inpainting when cn_type:Face",
"fooocus_upscaler_s409985e5.bin": "used for inpaint/outpaint and upscale/vary",
"clip_vision_vit_h.safetensors": "when mixing image prompt and vary upscale, mixing image prompt and inpaint or face",
"xlvaeapp.pth": "base SDXL VAE",
"vaeapp_sd15.pth": "base SD1.5 VAE",
"xl-to-v1_interposer-v3.1.safetensors": "used when interposing SD1.5 LoRas to SDXL",
"pytorch_model.bin": "base Fooocus expansion model",
"detection_Resnet50_Final.pth": "used for face restoration",
"parsing_parsenet.pth": "used for face restoration",
"model_base_caption_capfilt_large.pth": "used for CLIP interrogation" Whenever unsure, you can always spin up a local Fooocus installation or Fooocus-API in docker, delete models and run the processes you're planning to use to see what files are downloaded in the console output. |
Beta Was this translation helpful? Give feedback.
Since container size on its own won't affect its generation speed (the model sizes and resources of course can, but only when they're loaded for a task), the main reason to keep them tiny is your own time needed to upload them online and perhaps waiting for a new workers to download them.
But of course, it makes sense to remove models that you're sure you won't need. In fact, they're making most of the image size (currently uncompressed 17.7GB), which is also the reason why the
konieshadow/fooocus-api
is much smaller since it does not include them but instead downloads the first time you launch it, and then at times you hit certain controlnet endpoints to download the rest. As you already…