Showing posts with label tutorial. Show all posts
Showing posts with label tutorial. Show all posts

Sunday, 4 May 2025

免费建站探秘:菜鸟福音!免费主机+网站部署 - Free Website Mystery: Noob's Gospel! Free Hosting + Website Deployment

免费主机在手,建站不用愁!零成本拥有你的专属网站。- Free hosting in hand, no worries about building a website! Zero cost to own your exclusive site.


一、ClawCloud Run(https://run.claw.cloud/)


免费资源概览:

月赠 $5 美金额度:注册即享,GitHub 账号注册满 180 天者,每月自动续赠,无需绑定信用卡。

资源上限:4 核 CPU、8GB 内存。

存储空间:10G。

网络带宽:高质量 BGP 带宽,最高达 1Gbps,支持 IPv6。

每月流量:10G,开发够用,VPS够呛。

广告:体验清爽


快速部署 WordPress 网站步骤:

1. 访问 ClawCloud Run,注册账户。

2. 进入 Dashboard,点击“App Store”。

3. 找到 WordPress 应用。

4. 点击“Deploy”,耐心等待,大约要3-5分钟。

5. 可以做客制化设置,本文仅提供快速部署方案。

6. 部署完成后,点击应用详情中的“Public Address”,即可访问您的 WordPress 网站。当然,这只是容器好了,具体网站设置就看各位喜好。



二、AwardSpace(https://www.awardspace.com/)


免费资源概览:

存储空间:1 GB

每月流量:5 GB

访问量:约 5,000 次/月, 本身VPS服务不免费

数据库:1 个 MySQL 数据库

电子邮件账户:1 个

域名支持:可绑定 1 个域名及 3 个子域名

广告:无强制广告


从 Dashboard 开始部署 WordPress 网站步骤:

1. 访问 AwardSpace官网,点击“Signup”注册账户。

2. 登录后,进入 Dashboard。

3. 在“Hosting Tools/Domain Manager”部分,输入想要的域名,选择二级域名,完成注册。

4. 返回 Dashboard,在Hosting Tools/Zacky App Installer

5. 点Browser and install Apps按钮。

6. 在应用列表中,选择“WordPress”,点击“proceed to step2”。

7. 填写网站信息,如网站名称、管理员用户名和密码。

8. 点击“Install Application”,等待安装完成。

9. 安装完成后,访问已注册的域名,即可看到 WordPress 网站上线。




人生苦短,何必花冤枉钱?今天动手,明天就能向朋友炫耀:"看,这是我的网站!"

Wednesday, 26 March 2025

UI-TARS 本地部署:手残党福音,自然语言控电脑!- UI-TARS Local Deployment: Natural Language Control for Your Computer!

快速部署 UI-TARS,让你的电脑听懂人话!- Quick deployment of UI-TARS, make your computer understand human language!



UI-TARS本地部署指南(以Mac为例):


一、前置条件

系统:macOS Ventura 或更高版本

Python:3.9+(可通过 Homebrew 安装)


存储:至少 10GB 可用空间


二、部署步骤

1. 安装基础依赖


# 安装 Homebrew(已安装可跳过)

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"


# 安装 Python 和 Git(以python3.9为例, 不能低于3.9)

brew install python@3.9 git


# 创建并激活虚拟环境

python3.9 -m venv uitars_env && source uitars_env/bin/activate


2. 安装 PyTorch 和依赖


# 安装适配 Mac M芯片的 PyTorch

pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu


# 克隆仓库

git clone https://github.com/bytedance/UI-TARS.git && cd UI-TARS


# 安装项目依赖

pip install -r requirements.txt huggingface-hub bitsandbytes


3. 下载轻量模型


# 下载 Phi-2 模型(约 5GB), 如果硬件条件好,可以试试phi4

mkdir -p models/phi-2

huggingface-cli download microsoft/phi-2 --local-dir models/phi-2


4. 配置参数文件


# 修改配置文件(尽量只用CPU)

echo 'device: "cpu"\nmodel_path: "models/phi-2"\nquantize: 4bit' > configs/local_config.yaml


三、验证安装


1. 检查模型加载

python3 -c "from transformers import AutoModelForCausalLM; AutoModelForCausalLM.from_pretrained('models/phi-2'); print('✅ 模型加载成功')"


如果输出 模型加载成功!,则说明环境配置正确。


2. 运行示例


# 创建测试图片目录

mkdir test_images && curl -o test_images/demo.png https://example.com/sample-ui.png


# 执行推理

python3 scripts/predict.py --image test_images/demo.png --config configs/local_config.yaml


# 查看结果

cat outputs/demo.json


Monday, 30 December 2024

视频处理神器FFmpeg,超简单三招,告别模糊卡顿 - FFmpeg: Three Super Easy Tricks to Say Goodbye to Blurry Videos

自媒体、剪辑党福音!FFmpeg 超神助力,难题‘秒’解决,还不赶紧上车! - Good news for self-media and video editors! FFmpeg supercharges your work, solving problems in a flash. Jump on board!

嘿,做自媒体或是搞视频剪辑的小伙伴们,咱是不是都有过这些崩溃瞬间:辛辛苦苦压缩个视频,结果画面糊得像打了马赛克,美感全无;听到一段超赞的背景音乐,心痒痒想拿来当自己作品的 BGM 或者设成个性铃声,却死活找不到提取的门道;还有想快速截个视频片段,用软件操作一番后,得到的却是个画质惨不忍睹的 “残次品”。别愁啦,今天就给大伙介绍个超给力的神器 ——FFmpeg,保准让这些难题统统 “退下”!


FFmpeg,这个听起来就很有技术感的名字,其实比你想象的要亲民得多。它就像是一位隐身的视频专家,随时准备帮你解决那些看似复杂的问题。而且,安装FFmpeg简直不能再简单了。如果你是Mac用户,而且已经安装了Homebrew,那么只需在终端里输入一行命令,FFmpeg就能轻松成为你的囊中之物。或者Github手动安装。如果你更习惯于Windows系统,那么去FFmpeg的官方网站下载安装包,然后添加到环境变量,就能愉快地使用了。FFmpeg支持多平台,无论你是Mac、Windows还是Linux用户,都能轻松驾驭。它的帮助命令是”ffmpeg -h”。

好了,让我们来揭开FFmpeg的神秘面纱,看看它是如何用三个简单的命令,帮你解决视频压缩、音频提取和视频截取的问题。


首先,我们来看压缩视频的命令。你是否遇到过视频文件太大,想要压缩但又担心画质受损的问题?FFmpeg的这个命令能帮你在压缩的同时保持画质:


```

ffmpeg -i input.mp4 -c:v libx264 -r 25 -crf 21 -c:a aac output.mp4

```


这里的`-c:v libx264`指定了视频编码器为H264,`-r 25`设置了帧率为25,而`-crf 21`则是设置了码率,数值越小,质量越高。`-c:a aac`则是指定音频编码为AAC。是的,所谓压缩就是重新设置音频格式,视频格式,帧率和码率。


接下来,如果你听到了一段喜欢的背景音乐,想要提取出来做铃声或者提示音,FFmpeg也能轻松帮你实现:


```

ffmpeg -i input.mp4 -c:v libx264 -crf 21 -an output-v.mp4 -c:a aac -vn output-a.mp4

```


这里的`-an`是用来去掉音频的,而`-vn`则是去掉视频,让你只提取出音频文件(output-a.mp4)。


最后,如果你需要截取视频中的某一段,FFmpeg同样能帮你做到,而且避免了重新编码导致的画质损失:

```
ffmpeg -i input.mp4 -ss 00:00:01 -t 00:00:09 -c:v libx264 -crf 21 -c:a aac output.mp4
```

`-ss 00:00:01`表示从视频的第1秒开始截取,`-t 00:00:09`则是截取9秒的视频。


当你需要检查视频是否正常播放时,可以使用`ffplay output.mp4`命令,而如果你想要获取视频或音频的信息,`ffprobe output.mp4`则是你的好帮手。


FFmpeg就是这样一个简单易用的工具,它不仅能帮你告别视频模糊和卡顿,还能让你在视频处理的道路上越走越远。所以,亲爱的小伙伴们,不要再为视频处理的问题烦恼了,赶紧试试FFmpeg,让它成为你视频剪辑的好伙伴吧!



Hey, friends who are engaged in self-media or video editing. Haven't we all had these frustrating moments? After painstakingly compressing a video, the picture turns out to be as blurry as a mosaic, completely ruining the beauty. When hearing a wonderful background music, we itch to use it as the BGM of our own works or set it as a personalized ringtone, but we just can't find a way to extract it. And when we want to quickly clip a video segment, after using software to operate, what we get is a "defective product" with horrible picture quality. Don't worry. Today, I'm going to introduce you to a super powerful tool - FFmpeg, which will surely make these problems disappear!


FFmpeg, a name that sounds very technical, is actually much more approachable than you think. It's like an invisible video expert, ready to help you solve those seemingly complex problems at any time. And installing FFmpeg is as simple as it gets. If you're a Mac user and have Homebrew installed, you can easily get FFmpeg by typing a command in the terminal. Or Github to install it manually. If you're more accustomed to Windows, just download the installation package from FFmpeg's official website and add it to your environment variables, and you're good to go. FFmpeg supports multiple platforms, so whether you're a Mac, Windows, or Linux user, you can easily master it. Its help command is ‘ffmpeg -h’.


Now, let's unveil the mystery of FFmpeg and see how it uses three simple commands to solve the problems of video compression, audio extraction, and video trimming.


First, let's look at the command for compressing videos. Have you ever encountered the problem of video files being too large and wanting to compress them but worrying about the loss of picture quality? This FFmpeg command can help you compress while maintaining picture quality:


```

ffmpeg -i input.mp4 -c:v libx264 -r 25 -crf 21 -c:a aac output.mp4

```


Here, `-c:v libx264` specifies the video encoder as H264, `-r 25` sets the frame rate to 25, and `-crf 21` sets the bitrate, the smaller the value, the higher the quality. `-c:a aac` specifies the audio encoding as AAC. Yes, compression means resetting the audio format, video format, frame rate and bit rate.


Next, if you hear a piece of background music you like and want to extract it as a ringtone or notification sound, FFmpeg can easily help you achieve this:


```

ffmpeg -i input.mp4 -c:v libx264 -crf 21 -an output-v.mp4 -c:a aac -vn output-a.mp4

```


Here, `-an` is used to remove the audio, and `-vn` is to remove the video, allowing you to extract only the audio file(output-a.mp4).


Finally, if you need to trim a part of a video, FFmpeg can also help you do this while avoiding the blurriness caused by re-encoding:


```

ffmpeg -i input.mp4 -ss 00:00:01 -t 00:00:09 -c:v libx264 -crf 21 -c:a aac output.mp4

```


`-ss 00:00:01` means to start trimming from the 1st second of the video, and `-t 00:00:09` is to trim a 9-second video.


When you need to check if the video plays correctly, you can use the `ffplay output.mp4` command, and if you want to get information about the video or audio, `ffprobe output.mp4` is your good helper.


FFmpeg is such a simple and easy-to-use tool that not only helps you bid farewell to blurry and choppy videos but also allows you to go further on the road of video processing. So, dear friends, don't worry about video processing problems anymore, try FFmpeg, and let it become your good partner in video editing!


Sunday, 27 October 2024

ComfyUI & Stable Diffusion: The Ultimate Resource Hack - 1 Minute to Sync Models and Nodes - ComfyUI & Stable Diffusion:资源黑客终极指南 - 1分钟同步模型和节点

Stop Wasting, Start Syncing! - 停止浪费,开始同步!

Fed up with the hassle of double-dipping into model installations? Dive into our 60-second hack to sync ComfyUI with your local Stable Diffusion WebUI, sparing you the agony of redundant setups. We'll show you how to effortlessly glide through model, node, CLIP, VAE, and Lora configurations, turning your dual UI woes into a thing of the past. Plus, for path-confused AI artists, we've got the config file right here, ready for a quick tweak and roll.

Ready to unleash the power of your AI art tools without the clutter? First, hunt down that hidden gem in your ComfyUI folder—the 'extra_model_paths.yaml.example' file. Change its file name to ‘extra_model_paths.yaml’, and boom, you're in the game. Fire up your favorite text editor, or if you're feeling commando, dive into the terminal (Mac/Linux) or command prompt (Windows). Tweaking this configuration file to harness the magic of Stable Diffusion WebUI models, nodes, CLIP, VAE, and Lora, all from the cozy confines of your ComfyUI. The specific configuration file can refer to the following example.
# Rename this to extra_model_paths.yaml and ComfyUI will load it


# config for a1111 ui

a111:

    base_path: /Users/your_username/stable-diffusion-webui/  # 指向Stable Diffusion WebUI的安装路径

    checkpoints: models/Stable-diffusion  # Stable Diffusion模型的路径

    configs: models/Stable-diffusion  # Stable Diffusion配置文件的路径

    vae: models/VAE  # VAE模型路径

    loras: |

         models/Lora  # Lora模型路径

         models/LyCORIS  # LyCORIS模型路径(如果有的话)

    upscale_models: |

         models/ESRGAN  # ESRGAN模型路径

         models/RealESRGAN  # RealESRGAN模型路径

         models/SwinIR  # SwinIR模型路径

    embeddings: embeddings  # 文本嵌入路径

    hypernetworks: models/hypernetworks  # 超网络模型路径

    controlnet: models/ControlNet  # ControlNet模型路径


# config for comfyui

comfyui:

    base_path: /Users/your_username/ComfyUI/  # ComfyUI的安装路径

    checkpoints: /Users/your_username/stable-diffusion-webui/models/Stable-diffusion  # 指向A1111安装目录下的Stable Diffusion模型

    clip: /Users/your_username/stable-diffusion-webui/models/clip/  # 指向A1111的CLIP模型路径

    clip_vision: /Users/your_username/stable-diffusion-webui/models/clip_vision/  # CLIP视觉模型路径

    configs: /Users/your_username/stable-diffusion-webui/models/configs/  # Stable Diffusion的配置文件路径

    controlnet: /Users/your_username/stable-diffusion-webui/models/ControlNet/  # 指向ControlNet模型的路径

    embeddings: /Users/your_username/stable-diffusion-webui/embeddings/  # 嵌入模型路径

    loras: /Users/your_username/stable-diffusion-webui/models/Lora/  # Lora模型路径

    upscale_models: /Users/your_username/stable-diffusion-webui/models/upscale_models/  # 指向超分辨率模型路径

    vae: /Users/your_username/stable-diffusion-webui/models/VAE/  # VAE模型路径


All paths must be absolute paths to where the actual files are located on your system. - 所有路径必须是你系统上实际文件所在的绝对路径。