Package: carefree-portable
carefree-portable 📦️carefree-portable📦️ aims to help you create portable (Python 🐍) projects of your codes / repo!💡We are planning to:usevenvas a fallback solution for Linux / MacOS.(Done!)support other programming languages in the future, after Python is fully supported.SeeRoadmapfor more details.HighlightsPortable: The generated portable project can be used directly without any extra requirements.For example, you can run a portable Python project even without Python installed!Extensible: You can easily extend the functionality ofcarefree-portable📦️ by editing existing configurations, or adding brand newblock/presetwithout much effort.See theStable Diffusion Web UIexample on how we hijack the famous SD webui repo with a customblockand make it portable out-of-the-box.Integrable: You can integratecarefree-portable📦️ with (GitHub) CI to automatically generate a portable version of your project.Basically, you only need to create acfport.jsonfile in the root directory of your project, and then runcfport packagein your CI workflow (seeUsagesfor more details).Here's an example of howcarefree-portable📦️ packages itself into a portable version in the GitHub CI workflow.Installationcarefree-portable📦️ requires Python 3.8 or higher.pipinstallcarefree-portableorgitclonehttps://github.com/carefree0910/carefree-portable.gitcdcarefree-portable
pipinstall-e.UsagesDetailed usages can be found in theCLI&Configurationsdocumentation.Go to the root directory of your project first:cd<path/to/your/project>Generate ConfigTo generate a default config, run:cfportconfigThis command will genearte acfport.jsonfile in the current directory. To make it work properly, you may need to edit thepython_requirementsfield, which is a list of Python packages that your project depends on.Don't forget to add your own project to this field as well!PackagingAfter generating the config, you can package your project by running:cfportpackagePyTorchSince nowadays many fancy projects are built on top ofpytorch, we provided a preset config forpytorchprojects, which can be generated by:cfportconfig--presettorch-2.1.0-cu118# orcfportconfig--presettorch-2.1.0-cpuThis will generate acfport.jsonwith a pre-definedrequirementin thepython_requirementsfield.You may notice that the pre-definedrequirementstarts with$pipinstead ofpip. This is important because it can tellcarefree-portable📦️ to use the correctpipexecutable when packaging your project.Examplesmixtral, which can generate a portable gradio demo for the famousMixtral-8x7BLLM.Stable Diffusion Web UI, which can generate a portable version of the famousA1111 webui.Stable Diffusion - Playground v2, which can generate a portable version of the brilliantPlayground v2 HuggingFace Space.Playground v2itself is a fantastic SD model. It is said that images generated byPlayground v2are favored2.5times more than those produced by SDXL. See theiruser studyfor more details.Portablecarefree-portable📦️You may also download thecarefree-portable-*.zipfrom the assets of the latestReleases. The zip files contain the portable versions ofcarefree-portable📦️ that can be used directly:On Linux / MacOS, you still need to have Python installed (to activate thevenv), but no extra packages are required.On Windows, you can even run it without Python installed!If you are using this portable version, just make sure to:cdinto the unzippedcarefree-portable-*folder.Replacecfportwith.\run.bat(Windows) /bash run.sh(Linux / MacOS) in the following commands.Replacepythonwith<path\to\portable\python>in other python commands. The portablepythonlocates at:Windows:.\carefree-portable-*\python_embeddables\python-3.10.11-embed-amd64\python.Linux / MacOS:./carefree-portable-*/python_venv/bin/python3.Here's a step by step guide on how to use the portablecarefree-portable📦️ to run theStable Diffusion Web UIexample:Download thecarefree-portable-*.zipfrom the assets of the latestReleases.Unzip thecarefree-portable-*.zipto a folder (let's say,./carefree-portable-*), andcdinto it.Download therun.pyfromhere, and put it into the unzipped folder (./carefree-portable-*).Run the following command, and wait until the webui pops up:.\python_embeddables\python-3.10.11-embed-amd64\pythonrun.pyAfter these steps, you'll obtain a portable version of the SD webui (locates at./carefree-portable-*/sd_webui_cfport), which can be used directly without any extra requirements!ContributingContributions are truly welcomed!SeeCONTRIBUTING.mdfor more details.Licensecarefree-portable📦️ is MIT licensed, as found in theLICENSEfile.