png 格式工具

PNG 格式支持多种预定义的文本块类型(如 tEXt, iTXt, zTXt),用于存储文本信息(如作者、版权、描述等)。这些数据块会被大多数图片查看器和编辑器保留。

# 添加文本元数据
convert input.png -set "Description" "这是附加的注释" output.png

# 添加多个字段(如作者、版权)
convert input.png -set "Artist" "John Doe" -set "Copyright" "2024" output.png
identify -verbose output.png

安装:

图片加水印的命令行工具

在 Linux 或 macOS 系统中,可以通过命令行工具(如 ImageMagickffmpeg)快速为图片添加水印。以下是几种常用方法:


# Linux (Debian/Ubuntu)
sudo apt-get install imagemagick

# macOS
brew install imagemagick
convert input.jpg -font Arial -pointsize 40 -fill "rgba(255,255,255,0.5)" \
-gravity southeast -annotate +20+10 "Your Watermark" output.jpg

参数说明: • -font Arial:指定字体(使用 convert -list font 查看可用字体)。 • -pointsize 40:文字大小。 • -fill "rgba(255,255,255,0.5)":文字颜色和透明度(0=全透明,1=不透明)。 • -gravity southeast:水印位置(southeast=右下角,其他选项:north, center 等)。 • -annotate +20+10:距离边缘的偏移量(水平+20,垂直+10)。

ComfyUI教程

  • VAE:变分自动编码器
  • CLIP模型: 全称 Contrastive Language-Image Pre-Training(对比性语言-图像预训练模型

参考 gihtub 官网,直接下载桌面安装包:

这里提供各模型的使用说明:

llama.cpp 使用

git clone https://github.com/ggml-org/llama.cpp.git
mkdir build && cd build
cmake .. 
make && make install

一、GGUF量化过程

阿里千问系列模型

Github仓库:

所有的博客都会发表在这里:

如:

以下我们展示了一段简短的示例代码,说明如何通过 API 使用 QwQ-32B:

from openai import OpenAI
import os

# Initialize OpenAI client
client = OpenAI(
    # If the environment variable is not configured, replace with your API Key: api_key="sk-xxx"
    # How to get an API Key:https://help.aliyun.com/zh/model-studio/developer-reference/get-api-key
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    base_url="https://dashscope.aliyuncs.com/compatible-mode/v1"
)

reasoning_content = ""
content = ""

is_answering = False

completion = client.chat.completions.create(
    model="qwq-32b",
    messages=[
        {"role": "user", "content": "Which is larger, 9.9 or 9.11?"}
    ],
    stream=True,
    # Uncomment the following line to return token usage in the last chunk
    # stream_options={
    #     "include_usage": True
    # }
)

print("\n" + "=" * 20 + "reasoning content" + "=" * 20 + "\n")

for chunk in completion:
    # If chunk.choices is empty, print usage
    if not chunk.choices:
        print("\nUsage:")
        print(chunk.usage)
    else:
        delta = chunk.choices[0].delta
        # Print reasoning content
        if hasattr(delta, 'reasoning_content') and delta.reasoning_content is not None:
            print(delta.reasoning_content, end='', flush=True)
            reasoning_content += delta.reasoning_content
        else:
            if delta.content != "" and is_answering is False:
                print("\n" + "=" * 20 + "content" + "=" * 20 + "\n")
                is_answering = True
            # Print content
            print(delta.content, end='', flush=True)
            content += delta.content

WebDAV 搭建方案

借助传统Web服务器使用的WebDAV的方法有多种:

HttpAPI规范及生态组件

随着业务的增多,越来越多的服务需要提供http协议的API接口供第三方调用, 由于http api并不像trpc协议那样有一个通用的协议规范来定义约束接口, 通常API开发者需要提供一份API文档来说明每个API的详细参数。 如:腾讯云API文档 等, 这些文档分散在各个地方,缺乏统一的管理,并且每篇文档的撰写风格也不一样,这就增加了API调用方的接入负担。。。
总结一下,现有的API管理体系存在这如下缺点: