carefree-portable 📦️
carefree-portable 📦️ aims to help you create portable (Python 🐍) projects of your codes / repo!
💡We are planning to:
use(Done!)venvas a fallback solution for Linux / MacOS.- support other programming languages in the future, after Python is fully supported.
See Roadmap for more details.
Highlights
- Portable: 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 of
carefree-portable📦️ by editing existing configurations, or adding brand newblock/presetwithout much effort.- See the Stable Diffusion Web UI example on how we hijack the famous SD webui repo with a custom
blockand make it portable out-of-the-box.
- See the Stable Diffusion Web UI example on how we hijack the famous SD webui repo with a custom
- Integrable: You can integrate
carefree-portable📦️ with (GitHub) CI to automatically generate a portable version of your project.
Installation
carefree-portable 📦️ requires Python 3.8 or higher.
pip install carefree-portable
or
git clone https://github.com/carefree0910/carefree-portable.git
cd carefree-portable
pip install -e .
Usages
Detailed usages can be found in the CLI & Configurations documentation.
Go to the root directory of your project first:
cd <path/to/your/project>
Generate Config
To generate a default config, run:
cfport config
This command will genearte a cfport.json file in the current directory. To make it work properly, you may need to edit the python_requirements field, 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!
Packaging
After generating the config, you can package your project by running:
cfport package
PyTorch
Since nowadays many fancy projects are built on top of pytorch, we provided a preset config for pytorch projects, which can be generated by:
cfport config --preset torch-2.1.0-cu118
# or
cfport config --preset torch-2.1.0-cpu
This will generate a cfport.json with a pre-defined requirement in the python_requirements field.
You may notice that the pre-defined
requirementstarts with$pipinstead ofpip. This is important because it can tellcarefree-portable📦️ to use the correctpipexecutable when packaging your project.
Examples
- mixtral, which can generate a portable gradio demo for the famous
Mixtral-8x7BLLM. - Stable Diffusion Web UI, which can generate a portable version of the famous A1111 webui.
- Stable Diffusion - Playground v2, which can generate a portable version of the brilliant Playground v2 HuggingFace Space.
Playground v2itself is a fantastic SD model. It is said that images generated byPlayground v2are favored 2.5 times more than those produced by SDXL. See their user study for more details.
Portable carefree-portable 📦️
You may also download the carefree-portable-*.zip from the assets of the latest Releases. The zip files contain the portable versions of carefree-portable 📦️ that can be used directly:
- On Linux / MacOS, you still need to have Python installed (to activate the
venv), 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.- Replace
cfportwith.\run.bat(Windows) /bash run.sh(Linux / MacOS) in the following commands. - Replace
pythonwith<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.
- Windows:
Here's a step by step guide on how to use the portable carefree-portable 📦️ to run the Stable Diffusion Web UI example:
- Download the
carefree-portable-*.zipfrom the assets of the latest Releases. - Unzip the
carefree-portable-*.zipto a folder (let's say,./carefree-portable-*), andcdinto it. - Download the
run.pyfrom here, 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\python run.py
- After 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!
Contributing
Contributions are truly welcomed!
See CONTRIBUTING.md for more details.
License
carefree-portable 📦️ is MIT licensed, as found in the LICENSE file.
Metadata
Release files for carefree-portable 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| carefree-portable-0.1.2.tar.gz | 14.5 kB | Without provenance | Details |
Release files / carefree-portable-0.1.2.tar.gz
| Download URL | carefree-portable-0.1.2.tar.gz |
|---|---|
| Size | 14.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
edd558ba8174cfbd5d6bc94dfb347a85700ec4e2c5df5491c66de753416d0910
|
|
BLAKE2b-256 checksum How to use checksums |
1499918a99f3cb599cca18eaa7969f809272f81f1ad85086e7b8ae9c2d6de1ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|
Security for carefree-portable 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.