{"id":16107782,"url":"https://github.com/jhj0517/stable-diffusion-webui-layer-divider","last_synced_at":"2025-06-14T10:33:34.231Z","repository":{"id":153141140,"uuid":"626116414","full_name":"jhj0517/stable-diffusion-webui-Layer-Divider","owner":"jhj0517","description":"Layer-Divider, an extension for stable-diffusion-webui using the segment-anything model (SAM)","archived":false,"fork":false,"pushed_at":"2024-09-22T07:49:31.000Z","size":1659,"stargazers_count":165,"open_issues_count":6,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-10T19:24:25.969Z","etag":null,"topics":["ai","gradio","open-source","python","stable-diffusion","stable-diffusion-webui-plugin"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jhj0517.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-10T20:42:18.000Z","updated_at":"2024-10-08T08:30:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"a36a02aa-33c4-483a-a1f7-b7eda0f18b89","html_url":"https://github.com/jhj0517/stable-diffusion-webui-Layer-Divider","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jhj0517/stable-diffusion-webui-Layer-Divider","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhj0517%2Fstable-diffusion-webui-Layer-Divider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhj0517%2Fstable-diffusion-webui-Layer-Divider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhj0517%2Fstable-diffusion-webui-Layer-Divider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhj0517%2Fstable-diffusion-webui-Layer-Divider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jhj0517","download_url":"https://codeload.github.com/jhj0517/stable-diffusion-webui-Layer-Divider/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhj0517%2Fstable-diffusion-webui-Layer-Divider/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259802345,"owners_count":22913616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","gradio","open-source","python","stable-diffusion","stable-diffusion-webui-plugin"],"created_at":"2024-10-09T19:24:26.838Z","updated_at":"2025-06-14T10:33:34.209Z","avatar_url":"https://github.com/jhj0517.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Layer-Divider\nThis is an implementaion of the [SAM](https://github.com/facebookresearch/segment-anything) (Segment-Anything Model) within the [SD WebUI](https://github.com/AUTOMATIC1111/stable-diffusion-webui).\n\nDivide layers in the SD WebUI and save them as PSD files.\n\n![screenshot1](https://raw.githubusercontent.com/jhj0517/stable-diffusion-webui-Layer-Divider/master/screenshot.png)\n\n![screenshot2](https://raw.githubusercontent.com/jhj0517/stable-diffusion-webui-Layer-Divider/master/screenshot2.png)\n\n## About segment-anything-2\n\nIf you want to try [segment-anything-2](https://github.com/facebookresearch/segment-anything-2), there's a new dedicated webui :\n- https://github.com/jhj0517/stable-diffusion-webui-Layer-Divider\n\nThe web ui supports prompt and video segmentation, I recommend using the new web ui.\n\n# Installation\n`git clone https://github.com/jhj0517/stable-diffusion-webui-Layer-Divider.git` to your stable-diffusion-webui extensions folder.\u003cbr\u003e\nor alternatively, download and unzip the repository in your extensions folder!\n\n### Notice ( Read if you face an error during installation )\n**Some packages are problematic to install programmatically when starting webui.** \u003cbr\u003e\n**So you need to manually activate venv and install these packages before running webui.**\n1. Open the terminal in the WebUI and activate the venv\n```\nC:\\YourPath\\To_SD_WebUI\u003evenv\\Scripts\\activate\n```\nThen it will display (venv) in front of the terminal like this.\n```\n(venv) C:\\YourPath\\To_SD_WebUI\u003e\n```\n2. In this state, run\n```\npip uninstall -y pytoshop\npip uninstall -y packbits\npip install git+https://github.com/jhj0517/forked-pytoshop.git\npip install packbits\n```\n\n# How to use\nAdjust the parameters and click \"Generate\". The output will be displayed below, and a PSD file will be saved in the `extensions\\stable-diffusion-webui-layer-divider\\layer_divider_outputs\\psd` folder.\n\n## Explanation of Parameters\n\n| Parameter                      | Description                                                                                                                                                                                                                                                                              |\n|--------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| points_per_side                | The number of points to be sampled along one side of the image. The total number of points is points_per_side**2. If None, 'point_grids' must provide explicit point sampling.                                                                                                            |\n| pred_iou_thresh                | A filtering threshold in [0,1], using the model's predicted mask quality.                                                                                                                                                                                                               |\n| stability_score_thresh         | A filtering threshold in [0,1], using the stability of the mask under changes to the cutoff used to binarize the model's mask predictions.                                                                                                                                             |\n| crops_n_layers                 | If \u003e0, mask prediction will be run again on crops of the image. Sets the number of layers to run, where each layer has 2**i_layer number of image crops.                                                                                                                                |\n| crop_n_points_downscale_factor | The number of points-per-side sampled in layer n is scaled down by crop_n_points_downscale_factor**n.                                                                                                                                                                                 |\n| min_mask_region_area           | If \u003e0, postprocessing will be applied to remove disconnected regions and holes in masks with area smaller than min_mask_region_area. Requires opencv.                                                                                                                                  |\n\n## Todo\n- [ ] Migrate to [SAM-2](https://github.com/facebookresearch/segment-anything-2)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhj0517%2Fstable-diffusion-webui-layer-divider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjhj0517%2Fstable-diffusion-webui-layer-divider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhj0517%2Fstable-diffusion-webui-layer-divider/lists"}