Auto RunPod Installer For SDXL Background Replacement for Product Images - Make Amazing Product Ads For Shopify
🕑 Added 2023-09-27 14:26:48 +0000 UTCNew Installer : https://www.patreon.com/posts/89914747
New Installer : https://www.patreon.com/posts/89914747
New Installer : https://www.patreon.com/posts/89914747
This post is deprecated not anymore maintained use above one
This post is deprecated not anymore maintained use above one
This post is deprecated not anymore maintained use above one
-
-
-
-
-
-
Join discord and tell me your discord username to get a special rank : SECourses Discord
29 March 2024 Update
Libraries updated to latest to work better
Now cache files downloaded into workspace so you can turn off pod and start using again immediately
Install & Run Instructions updated and made better
27 September 2023 Major Update
Added so many new options
Also it will now auto save all images inside outputs folder

Install Instructions
RunPod io link > https://runpod.io?ref=1aka98lq
* Select RunPod Pytorch template
The Pytorch template doesn't matter
Here screenshots : pytorch.png, ptorch2.png
If you get killed error pick more RAM having Pod such as A6000
Download attached install.sh and then upload it into your Workspace folder
Run Below Command To Install
export HF_HOME="/workspace"
chmod +x install.sh
./install.sh
After installation has been completed run below command to start the app
To Start The App
export HF_HOME="/workspace"
cd /workspace/background-replacement
source venv/bin/activate
python app.py --share
You can also remove --share and use proxy connect 7860 but it is not working good right now. So use Gradio share.
This will give you a gradio shared link like below

Some examples
Comments
Furkan Gözükara
hello. this is not made for google colab. on google colab you can't make venv. i may try to make kaggle version later but currently super busy :/
Vince Ma
Tried in Google Colab, not working. All steps seems fine, until: 1. requirement.txt inside "background-replacement" folder, when install it gave me "ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'". Need to enter the folder and install it. 2. When I ran "source venv/bin/activate", it said "-bash: venv/bin/activate: No such file or directory" 3. When I ran "python app.py --share": 2024-05-10 06:54:23.018775: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:9261] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered 2024-05-10 06:54:23.018830: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:607] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered 2024-05-10 06:54:23.020413: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1515] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered 2024-05-10 06:54:24.199208: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT Initializing captioner... Downloading config.json: 100%|███████████████████████████████████████████████████████████████████████████████████████████| 4.56k/4.56k [00:00<00:00, 19.1MB/s] Downloading pytorch_model.bin: 100%|████████████████████████████████████████████████████████████████████████████████████████| 990M/990M [00:03<00:00, 253MB/s] Downloading tokenizer_config.json: 100%|█████████████████████████████████████████████████████████████████████████████████████| 506/506 [00:00<00:00, 2.75MB/s] Downloading vocab.txt: 100%|███████████████████████████████████████████████████████████████████████████████████████████████| 232k/232k [00:00<00:00, 1.83MB/s] Downloading tokenizer.json: 100%|██████████████████████████████████████████████████████████████████████████████████████████| 711k/711k [00:00<00:00, 2.82MB/s] Downloading (…)cial_tokens_map.json: 100%|████████████████████████████████████████████████████████████████████████████████████| 125/125 [00:00<00:00, 567kB/s] Downloading (…)rocessor_config.json: 100%|███████████████████████████████████████████████████████████████████████████████████| 287/287 [00:00<00:00, 1.61MB/s] Initializing upscaler... Initializing segmenter... Cloning into 'gitxuebinqinDIS'... remote: Enumerating objects: 355, done. remote: Counting objects: 100% (121/121), done. remote: Compressing objects: 100% (45/45), done. remote: Total 355 (delta 96), reused 85 (delta 76), pack-reused 234 Receiving objects: 100% (355/355), 49.60 MiB | 24.14 MiB/s, done. Resolving deltas: 100% (172/172), done. Downloading isnet-general-use.pth: 100%|████████████████████████████████████████████████████████████████████████████████████| 177M/177M [00:01<00:00, 161MB/s] rmdir: failed to remove '/S': No such file or directory rmdir: failed to remove '/Q': No such file or directory rmdir: failed to remove 'gitxuebinqinDISIS-Net__pycache__': No such file or directory sh: 1: move: not found Traceback (most recent call last): File "/content/drive/MyDrive/SDXL Background Replacement/background-replacement/app.py", line 3, in from background_replacer import replace_background File "/content/drive/MyDrive/SDXL Background Replacement/background-replacement/background_replacer.py", line 25, in init_segmenter() File "/content/drive/MyDrive/SDXL Background Replacement/background-replacement/segmenter.py", line 35, in init import data_loader_cache ModuleNotFoundError: No module named 'data_loader_cache' Not be able to run!!!
Furkan Gözükara
inside pipeline py pipe = StableDiffusionXLControlNetPipeline.from_pretrained(
Dmitry
Tell me, please, how can I change the generation model?
Furkan Gözükara
nice tips thank you
Dmitry
If you encounter a terminal malfunction problem (it is impossible to insert a command into the terminal), stop the pod and start it again, and the terminal will work as it should
Furkan Gözükara
We also added free kaggle notebook : https://www.patreon.com/posts/auto-windows-for-89914747
Furkan Gözükara
with 12 gb it should work perfect. but i think would work decent on 10 GB GPUs
Furkan Gözükara
Kaggle notebook is made : https://www.patreon.com/posts/89914747
Furkan Gözükara
may run on kaggle i have to test
leem0nchu
What are the VRAM requirements?
AI Squad
Is it possible to run this model on Kaggle or Colab?
Furkan Gözükara
well do paperspace allow venv? activate venv and do pip install gradio==3.50.2
hi mizu
Hello. i try to use this code on Paperspace. but it showed "Traceback (most recent call last): File "/notebooks/background-replacement/app2.py", line 2, in import gradio as gr ModuleNotFoundError: No module named 'gradio'" I thought gradio had been already installed, what do you think? I should not use Paperspace?
Furkan Gözükara
thank you so much for letting me know. i just fixed the error. i am so sorry for the delay
ch
dear teacher, i run on RunPod, show error: segmenter import init as init_segmenter, segment ModuleNotFoundError: No module named 'segmenter' ---can you help me?
Furkan Gözükara
ye this is it with more features . you can run both locally and also on runpod
DAVID PEREZ
Thank you for sharing this, also i found a tool made by Shopify that lets anyone change the backgrounds for free https://huggingface.co/spaces/Shopify/background-replacement



