<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Python on 🌲Treetopia🌲</title>
    <link>https://tree2601.github.io/en/tags/python/</link>
    <description>Recent content in Python on 🌲Treetopia🌲</description>
    <generator>Hugo -- 0.154.2</generator>
    <language>en</language>
    <lastBuildDate>Wed, 04 Feb 2026 22:13:42 +0800</lastBuildDate>
    <atom:link href="https://tree2601.github.io/en/tags/python/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Z Image Turbo</title>
      <link>https://tree2601.github.io/en/posts/2026/z-image-turbo/</link>
      <pubDate>Wed, 04 Feb 2026 22:13:42 +0800</pubDate>
      <guid>https://tree2601.github.io/en/posts/2026/z-image-turbo/</guid>
      <description>&lt;h3 id=&#34;content&#34;&gt;&lt;strong&gt;Content&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;This article introduces the usage of Z-Image-Turbo in conjunction with ComfyUI.&lt;/p&gt;
&lt;p&gt;Advantages of Z-Image-Turbo:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Strong Chinese prompt-following and Chinese character generation capabilities.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Requires only 8 inference steps for image generation. With a compact 6B parameter count, it can run on consumer-grade hardware (16GB VRAM) using quantization.&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Due to network restrictions in certain regions that prevent the use of ComfyUI-Manager for automatic downloads, all file downloads are provided for manual installation.&lt;/p&gt;</description>
    </item>
    <item>
      <title>ComfyUI Guide</title>
      <link>https://tree2601.github.io/en/posts/2026/comfyui/</link>
      <pubDate>Wed, 14 Jan 2026 11:11:51 +0800</pubDate>
      <guid>https://tree2601.github.io/en/posts/2026/comfyui/</guid>
      <description>&lt;h3 id=&#34;content&#34;&gt;Content&lt;/h3&gt;
&lt;p&gt;This guide details the deployment of ComfyUI on Ubuntu 22.04, including the manual installation of ComfyUI Manager for extended functionalities (custom nodes) and the manual installation of custom nodes, specifically tailored for &lt;strong&gt;users within China&amp;rsquo;s network environment&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Official Documentation: &lt;a href=&#34;https://docs.comfy.org/zh-CN/installation/manual_install&#34;&gt;ComfyUI&lt;/a&gt;&lt;/p&gt;
&lt;h3 id=&#34;installation&#34;&gt;Installation&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;First, ensure you have a &lt;a href=&#34;https://tree2601.github.io/en/posts/2026/conda/&#34;&gt;conda&lt;/a&gt; environment on your server and create a new one.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-Plain&#34; data-lang=&#34;Plain&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;# Clone the ComfyUI git repository
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git clone https://github.com/Comfy-Org/ComfyUI.git
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;# Navigate to the ComfyUI directory, activate the conda environment, and install dependencies
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;cd ComfyUI
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;conda activate comfyui_env
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;pip install -r requirements.txt
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;# Start ComfyUI, specifying the port number and GPU device
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;python main.py --listen --port 10020 --cuda-device 0
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;install-comfyui-manager&#34;&gt;Install ComfyUI Manager&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;```Plain
# Change to the custom_nodes subdirectory
cd custom_nodes

# If your network environment has no restrictions
git clone https://github.com/ltdrdata/ComfyUI-Manager.git

# If your network environment has restrictions, manually download the [repository](https://github.com/Comfy-Org/ComfyUI-Manager),
# unzip it, rename the folder to ComfyUI-Manager, and place it in custom_nodes.
# Then, restart ComfyUI.
python main.py --listen --port 10020 --cuda-device 0
```
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&#34;install-any-plugins&#34;&gt;Install Any Plugins&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;i.  If the ComfyUI Manager GUI can download nodes:

ii.  If the ComfyUI Manager GUI consistently fails to download nodes:

```Plain
# Clone the corresponding git repository, rename it, and place it in custom_nodes.
git clone https://github.com/some/custom/nodes.git

# Navigate into the node&#39;s directory and install its dependencies.
pip install -r requirements.txt

# Restart ComfyUI.

# Some commonly used custom nodes:
# --Control Net: https://github.com/Fannovel16/comfyui_controlnet_aux
# --ComfyUI-Impact-Pack: https://github.com/ltdrdata/ComfyUI-Impact-Pack
# --rgthree-comfy: https://github.com/rgthree/rgthree-comfy


```
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&#34;quick-start&#34;&gt;Quick Start&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;The most widely used text-to-image model is Flux. Setting up a workflow using it is an excellent starting point.&lt;/li&gt;
&lt;li&gt;Images generated by ComfyUI contain workflow information, which can be directly dragged into the GUI to re-create the workflow.&lt;/li&gt;
&lt;li&gt;Example 1: Flux + Lora + ControlNet Workflow
&lt;img alt=&#34;workflow-1&#34; loading=&#34;lazy&#34; src=&#34;https://tree2601.github.io/images/comfyui/workflow-1.png&#34;&gt;&lt;/li&gt;
&lt;li&gt;Example 2: MimicMotion Action Simulation Workflow
&lt;img alt=&#34;workflow-2&#34; loading=&#34;lazy&#34; src=&#34;https://tree2601.github.io/images/comfyui/workflow-2.png&#34;&gt;&lt;/li&gt;
&lt;/ol&gt;</description>
    </item>
    <item>
      <title>Conda Guide</title>
      <link>https://tree2601.github.io/en/posts/2026/conda/</link>
      <pubDate>Wed, 07 Jan 2026 09:18:13 +0800</pubDate>
      <guid>https://tree2601.github.io/en/posts/2026/conda/</guid>
      <description>&lt;h3 id=&#34;overview&#34;&gt;Overview&lt;/h3&gt;
&lt;p&gt;This guide covers installing Conda on Ubuntu 22.04, migrating the Conda path to a data disk, configuring mirror sources (for regions with internet restrictions), and methods for packing environments for offline deployment.&lt;/p&gt;
&lt;h3 id=&#34;installation-package&#34;&gt;Installation Package&lt;/h3&gt;
&lt;p&gt;Use &lt;code&gt;wget&lt;/code&gt; or click to download the &lt;a href=&#34;https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh&#34;&gt;Installation Package&lt;/a&gt; directly.&lt;/p&gt;
&lt;h3 id=&#34;add-conda-to-path-for-persistence&#34;&gt;Add Conda to PATH for Persistence&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Locate the conda command&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;which conda
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Check the conda root installation directory&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;conda info --base
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Open ~/.bashrc and add the following line at the bottom&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;export&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;PATH&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;/home/ubuntu/miniconda3/bin:&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$PATH&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Apply changes&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;source&lt;/span&gt; ~/.bashrc
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;conda init
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Restart your terminal session&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;configure-storage-paths-for-environments-and-packages&#34;&gt;Configure Storage Paths for Environments and Packages&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c&#34;&gt;# Open ~/.condarc and add the following lines:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;envs_dirs&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;- &lt;span class=&#34;l&#34;&gt;/your/path/to/conda/envs&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;pkgs_dirs&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;- &lt;span class=&#34;l&#34;&gt;/your/path/to/conda/pkgs&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;configure-conda-mirror-sources-china&#34;&gt;Configure Conda Mirror Sources (China)&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Using Aliyun mirrors as an example&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;conda config --add channels https://mirrors.aliyun.com/anaconda/pkgs/main/
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;conda config --add channels https://mirrors.aliyun.com/anaconda/pkgs/free/
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;conda config --add channels https://mirrors.aliyun.com/anaconda/cloud/conda-forge/
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;conda config --add channels https://mirrors.aliyun.com/anaconda/cloud/bioconda/
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Verify the configuration&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;conda config --show channels
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;create-conda-environments&#34;&gt;Create Conda Environments&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Create an environment (at a specific path or using the default path)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;conda create --prefix /your/path/to/conda/envs/my_env &lt;span class=&#34;nv&#34;&gt;python&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;3.12
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;conda create -n my_env &lt;span class=&#34;nv&#34;&gt;python&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;3.12
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Activate the new environment&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;conda activate my_env
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;list-existing-environments&#34;&gt;List Existing Environments&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;conda info --envs
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;examples-using-pipuv-within-conda&#34;&gt;Examples: Using pip/uv within Conda&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Using pip&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;pip install tqdm -i https://mirrors.aliyun.com/pypi/simple/
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Using uv for faster installation&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;uv pip install tqdm -i https://mirrors.aliyun.com/pypi/simple/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;pack-conda-environments&#34;&gt;Pack Conda Environments&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Pack an existing conda environment:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# (Note: Requires conda-pack to be installed)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;conda pack -n my_env
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Transfer the archive to the target server and extract it&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;tar -xvzf my_env.tar.gz -C /your/conda/envs/my_env
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;dockerizing-local-conda-environments&#34;&gt;Dockerizing Local Conda Environments&lt;/h3&gt;
&lt;p&gt;Example &lt;code&gt;Dockerfile&lt;/code&gt;:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
