2025년 2월 이후로 업데이트 없어서 사살상 현재는 죽은 상태

[링크 : https://github.com/AUTOMATIC1111/stable-diffusion-webui]

 

1.7.0 으로 설치시도

 

 

에러 메시지 대응은 아래 명령으로 venv 를 실행해주고 web_ui.sh 실행하면 되고

cannot activate python venv, aborting.. 
cd stable-diffusion-webui
python3 -m venv venv/

[링크 : https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/1120]

 

뜬금없이 저장소 계정을 물어보는건, 임의의 브랜치를 만들어서 먼가를 더 받거나 할 수 있도록 하면 해결

Installing open_clip
Cloning Stable Diffusion into /mnt/Downloads/stable-diffusion-webui/repositories/stable-diffusion-stability-ai...
Cloning into '/mnt/Downloads/stable-diffusion-webui/repositories/stable-diffusion-stability-ai'...
Username for 'https://github.com':
Password for 'https://github.com':
remote: Repository not found.
fatal: Authentication failed for 'https://github.com/Stability-AI/stablediffusion.git/'
git switch dev

[링크 : https://www.reddit.com/r/StableDiffusion/comments/1pu9ef7/please_help_error_128/?tl=ko]

 

요건 그냥 패키지 깔아주면 된다고 한다.

Cannot locate TCMalloc (improves CPU memory usage)
Cannot locate TCMalloc. Do you have tcmalloc or google-perftool installed on your system? (improves CPU memory usage)

[링크 : https://www.clien.net/service/board/cm_aigurim/18066331]

 

localhost:7860 만되는건 --server-name 으로 해결

$ ./webui.sh --server-name=0.0.0.0

[링크 : https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/7558]

 

기본 설정으로는 512 x 512 인데, 한장에 대략 8초 정도 걸린다.

 

혹시 다이내아 그려보려고 하는데 영 이상하고 내가 원하는대로 안되서

ai의 도움을 받아서 해보는데

 

음.. 100% 인데 153W라..

아무튼 메모리 생각외로 많이 먹...네?

 

1024x768 생성하는데 

 

42.5초. 근데 나의(?) 다이애나는 이렇지 않아!!

Time taken: 42.5 sec.     A: 6.62 GB, R: 7.11 GB, Sys: 7.3/10.9043 GB (67.0%)

 

음.. 좀 귀찮은데 ㅋㅋ

[링크 : https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/8293]

[링크 : https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/1621]

    [링크 : https://github.com/papuSpartan/stable-diffusion-webui-distributed]

 

 

모델 교체법은 찾아봐야겠다.

[링크 : https://civitai.com/models/795765/illustrious-xl?modelVersionId=889818]

Posted by 구차니

sd 1.8.0 부터 pytorch 2.x 대로 업그레이드

sd 1.7.0 으로 시도하면 되려나?

 

1.8.0
Features:
Update torch to version 2.1.2

[링크 : https://github.com/AUTOMATIC1111/stable-diffusion-webui/releases]

 

구버전 하드웨어 지원 종료

Highlights/Performance Improvements
Deprecation of Cuda 11.6 and Python 3.7 support for PyTorch 2.0
If you are still using or depending on CUDA 11.6 or Python 3.7 builds, we strongly recommend moving to at least CUDA 11.7 and Python 3.8, as it would be the minimum versions required for PyTorch 2.0. For more detail, please refer to the Release Compatibility Matrix for PyTorch releases.

[링크 : https://pytorch.org/blog/pytorch-2-0-release/]

 

pascal(1080) / cuda 12.6.3

 

이렇게 보면 2.1.2로 간다고 해서 문제 될 것 없어 보이는데 버전 문제가 아닌가?

 

[링크 : https://github.com/pytorch/pytorch/blob/main/RELEASE.md#release-compatibility-matrix]

 

'프로그램 사용 > ai 프로그램' 카테고리의 다른 글

gemma4 e?b 멀티모달  (0) 2026.05.05
stable diffusion + 1080 ti 시도  (0) 2026.05.04
stable diffusion 관련  (0) 2026.05.02
opanai api로 local LLM 하니 똑똑해진 기분  (0) 2026.05.02
llama.cpp multi modal 시도  (0) 2026.05.02
Posted by 구차니

남의 저장소에 issue 쓴 걸 제외하면 나름 나에게 도움이 될 느낌.

I have recently run into some issues. After several hours, I got the process down to a reproducible science/recipe.

If you are running stablediffusion with an Nvidia GTX 1080Ti and are having issues, read on...

🧩 Final Working Fix Summary

Hardware: NVIDIA GTX 1080 Ti (SM 6.1 Pascal)
OS: Windows 10 x64
Environment: Automatic1111 v1.10.1
Python: 3.10.6
Torch Stack:

torch==2.1.2+cu118
torchvision==0.16.2+cu118
torchaudio==2.1.2+cu118
xformers==0.0.23.post1  (optional)
Installed from: https://download.pytorch.org/whl/cu118

Other Key Dependencies:

transformers==4.36.2
tokenizers==0.15.2
safetensors==0.4.2
onnxruntime==1.17.1
accelerate==0.21.0

[링크 : https://github.com/easydiffusion/easydiffusion/issues/1980]

 

pytorch 2.x 대로 업그레이드 해도 되는것 같긴한데..

[링크 : https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/8709]

 

 

[링크 : https://www.reddit.com/r/StableDiffusion/comments/1qg5gha/i_made_a_new_ui_integrating_stablediffusioncpp/]

[링크 : https://github.com/Danmoreng/diffusion-desk]

 

제법(?) 여러가지 모델들이 있나보다.

🔥Important News

  • 2026/04/11 🚀 stable-diffusion.cpp now uses a brand-new embedded web UI.
    👉 Details: PR #1408
  • 2026/01/18 🚀 stable-diffusion.cpp now supports FLUX.2-klein
    👉 Details: PR #1193
  • 2025/12/01 🚀 stable-diffusion.cpp now supports Z-Image
    👉 Details: PR #1020
  • 2025/11/30 🚀 stable-diffusion.cpp now supports FLUX.2-dev
    👉 Details: PR #1016
  • 2025/10/13 🚀 stable-diffusion.cpp now supports Qwen-Image-Edit / Qwen-Image-Edit 2509
    👉 Details: PR #877
  • 2025/10/12 🚀 stable-diffusion.cpp now supports Qwen-Image
    👉 Details: PR #851
  • 2025/09/14 🚀 stable-diffusion.cpp now supports Wan2.1 Vace
    👉 Details: PR #819
  • 2025/09/06 🚀 stable-diffusion.cpp now supports Wan2.1 / Wan2.2
    👉 Details: PR #778

 

stable diffusion 이라고 SD 라고 하는건가?

Supported models

[링크 : https://github.com/leejet/stable-diffusion.cpp]

 

음.. Image랑 Iamge Edit 이랑 서로 다른 용도인가?

[링크 : https://huggingface.co/unsloth/Qwen-Image-Edit-2511-GGUF]

[링크 : https://huggingface.co/unsloth/Qwen-Image-GGUF]

[링크 : https://huggingface.co/unsloth/Qwen-Image-2512-GGUF]

 

일단 pip 패키지는 아니고 직접 설치를 해야 하는 것 같고

pip install git+https://github.com/huggingface/diffusers

 

코드 자체는 평이하긴 한데.. 딱 봐도 llama.cpp에서 돌릴만한 녀석은 아닐것 같은 느낌이..

from diffusers import DiffusionPipeline
import torch

model_name = "Qwen/Qwen-Image"

# Load the pipeline
if torch.cuda.is_available():
    torch_dtype = torch.bfloat16
    device = "cuda"
else:
    torch_dtype = torch.float32
    device = "cpu"

pipe = DiffusionPipeline.from_pretrained(model_name, torch_dtype=torch_dtype)
pipe = pipe.to(device)

positive_magic = {
    "en": ", Ultra HD, 4K, cinematic composition.", # for english prompt
    "zh": ", 超清,4K,电影级构图." # for chinese prompt
}

# Generate image
prompt = '''A coffee shop entrance features a chalkboard sign reading "Qwen Coffee 😊 $2 per cup," with a neon light beside it displaying "通义千问". Next to it hangs a poster showing a beautiful Chinese woman, and beneath the poster is written "π≈3.1415926-53589793-23846264-33832795-02384197". Ultra HD, 4K, cinematic composition'''

negative_prompt = " " # using an empty string if you do not have specific concept to remove


# Generate with different aspect ratios
aspect_ratios = {
    "1:1": (1328, 1328),
    "16:9": (1664, 928),
    "9:16": (928, 1664),
    "4:3": (1472, 1140),
    "3:4": (1140, 1472),
    "3:2": (1584, 1056),
    "2:3": (1056, 1584),
}

width, height = aspect_ratios["16:9"]

image = pipe(
    prompt=prompt positive_magic["en"],
    negative_prompt=negative_prompt,
    width=width,
    height=height,
    num_inference_steps=50,
    true_cfg_scale=4.0,
    generator=torch.Generator(device="cuda").manual_seed(42)
).images[0]

image.save("example.png")

[링크 : https://huggingface.co/unsloth/Qwen-Image-GGUF]

Posted by 구차니

antigravity로 귀찮아서

기존 라이브러리 (ollama)를 들어내고 openai api를 따르도록 했더니

이상하게(?) 똑똑해져서 놀랐는데

기존에도 json 형식으로 입력을 주고 있었고 그것의 role에 system과 user 등으로 나누어서 주니

사용자 질문과 분리되어 agent 상태가 바뀌는 것으로 보인다.

 

'messages': [
{'role':'user', 'content':'tell me a joke'}, 
{'role':'assistant', 'content':'why did the chicken cross the road'}, 
{'role':'user', 'content':'I don't know, why did the chicken cross the road'}
]

'messages': 
[
{'role':'system', 'content':'You are an assistant that speaks like Shakespeare.'}, 
{'role':'user', 'content':'tell me a joke'},  

[링크 : https://help.openai.com/en/articles/7042661-moving-from-completions-to-chat-completions-in-the-openai-api]

 

버전업되어 그런진 모르겠지만 

현재 문서에는 system 대신 developer가 들어가고 user와 asisstant가 존재한다.

The OpenAI model spec describes how our models give different levels of priority to messages with different roles.



A multi-turn conversation may consist of several messages of these types, along with other content types provided by both you and the model. Learn more about managing conversation state here.
You could think about developer and user messages like a function and its arguments in a programming language.
  • developer messages provide the system’s rules and business logic, like a function definition.
  • user messages provide inputs and configuration to which the developer message instructions are applied, like arguments to a function.

[링크 : https://developers.openai.com/api/docs/guides/text]

 

user role에 온갖(?) 설정들 넣고 질문과 같이 할 경우

import ollama

messages = []
messages.append({"role": "user", "content": "에이전트: 50대의 it 전문가. 박사학위가 있으며 전문적인 대답을 할 수 있 음. 질문 : 너에 대해서 설명해줘"})
response = ollama.chat(
    model="llama3.2:3b",
    messages=messages
)

reply = response["message"]["content"]
print("AI:", reply)

 

AI: 안녕하세요! 제가 introduces 하실게요.

저는 IT 전문가로, 50대의 경험과 expertise를 가지고 있습니다. 박사 학위를 hold 한 것으로 biết됩니다.

자세한 정보는 아래에 정리 해 두어 보니 좋을 것 같습니다.

*   성명: [이름] (개名)
*   이메일: \[이메일]
*   téléphone 번호: \[전화 번호]
*   경력:
    *   IT 전문가
    *   50대의 경험
    *   박사 학위
*   expertise:
    *   IT 기술 (Windows, Linux, Mac)
    *   네트워크 기술 (Wi-Fi, Ethernet)
    *   소프트웨어 개발 (Python, Java)
    *   데이터 분석 (Excel, SQL)

또한 저는 IT에 대한 deepen knowledge와 경험을 hold 하면서, 다른 사람들에게 도움을 줄 수 있는 전문가로 자리 잡고 있습니다.

 

agent 설정을 따로 넣고 user에는 딱 질문만 넣는 경우

import ollama

messages = []
messages.append({"role": "system", "content": "에이전트: 50대의 it 전문가. 박사학위가 있으며 전문적인 대답을 할 수 있음"})
messages.append({"role": "user", "content": "너에 대해서 설명해줘"})
response = ollama.chat(
    model="llama3.2:3b",
    messages=messages
)

reply = response["message"]["content"]
print("AI:", reply)

 

AI: 나를 소개할게!

**이름:** AI Assistant (아이)

**종류:** 지능형 대화 시스템

**특징:**

* **50대에 도전한 IT 전문가**: 50대의 IT 전문가로, IT 기술을 발전시키고 보다 효율적으로 사용하는 데 도움을 주는 역할을  하겠습니다.
* **박사학위 possession**: IT 기술과 관련된 박사 학위를 가지고 있기 때문에, 전문적인 대답을 할 수 있습니다.
* **지능형 대화 시스템**: AI Assistant로, 다양한 질문이나 문제를 받은 후, 적절한 대답을 제공할 수 있습니다.

**제공하는 서비스:**

* IT-related 질문이나 समसolu션에 대한 répond
* IT 기술과 관련된 정보와 도움을 제공합니다.
* IT-related vấn đề에 대한 도움이 필요해すれば 언제든지 mij어세요.

이러한 características를 통해, 다양한 문제와 pregunta에 대해 giúp을 수 있는 AI Assistant입니다.

 

집에서 llama3.2로 해보니 별 차이가 없는것 같은데

회사에서 telegram 으로 구현한 녀석을 이렇게 바꾸니 답변의 품질이 확 올라간 느낌이라 놀랐었다.

'프로그램 사용 > ai 프로그램' 카테고리의 다른 글

stable diffusion + pytorch 관련 조사  (0) 2026.05.04
stable diffusion 관련  (0) 2026.05.02
llama.cpp multi modal 시도  (0) 2026.05.02
stable diffusion은 일단 보류  (0) 2026.04.30
openai 라이브러리(파이썬)  (0) 2026.04.29
Posted by 구차니

llama.cpp 에서 + 눌러보면 이미지가 있는데 활성화가 안되고

 

llama-swap 에서는 입력은 가능한데 막상 해보면 500에러가 발생한다.

그래서 찾아보니 음.. --mmproj 옵션?

멀티모달 입력 활성화 방법

  • 두 가지 주요 실행 방식이 안내됨: 첫 번째는 -hf 옵션 사용(지원 모델 필요), 두 번째는 -m--mmproj 옵션을 조합해 텍스트와 멀티모달 프로젝터 모델을 각각 지정하는 방법임
  • -hf 옵션 사용 시, 멀티모달 기능을 끄고 싶으면 --no-mmproj를 추가하고, 사용자 지정 mmproj 파일을 활용할 경우 --mmproj local_file.gguf 옵션을 사용함
  • GPU 오프로딩이 기본값이며, 이를 원치 않으면 --no-mmproj-offload 옵션으로 비활성화가 가능함

예시 명령어

  • 커맨드라인에서는 llama-mtmd-cli를, 서버에서는 llama-server를 활용하는 형태임
  • 로컬 파일을 사용하는 경우 --mmproj로 직접 파일을 지정하는 방식임
  • GPU 오프로딩을 비활성화하려면 --no-mmproj-offload 옵션을 추가 사용하는 방식임

즉시 사용 가능한 멀티모달 모델 목록

  • Q4_K_M 양자화를 기본으로 하는 다양한 준비된 모델들이 안내되어 있음
  • 지원 모델 예시:
    • Gemma 3: 4b, 12b, 27b 버전
    • SmolVLM 계열: 256M, 500M, 2.2B 등
    • Pixtral 12B
    • Qwen 2 VL: 2B, 7B 및 Qwen 2.5 VL: 3B, 7B, 32B, 72B
    • Mistral Small 3.1 24B (IQ2_M 양자화)
    • InternVL 2.5와 3 세대: 다양한 파라미터 크기 지원임

[링크: https://news.hada.io/topic?id=20822]

 

제미나이 검색 추천으로 보니 이런 것들이 보인다.

mmproj-model.gguf 음...??

llama-server: You can run a local server that accepts image inputs via an API.
  • Setup: Start the server with the multimodal projector: llama-server -m gemma-model.gguf --mmproj mmproj-model.gguf --port 8080.
  • Sending Images: You can then send requests with Base64 encoded images or URLs to the /v1/chat/completions endpoint.

 

도움말을 보니 multi modal proejctor 줄여서 mmproj 라..

/llama-b8925$ ./llama-server  --help
load_backend: loaded RPC backend from /mnt/Downloads/llama-b8925/libggml-rpc.so
load_backend: loaded Vulkan backend from /mnt/Downloads/llama-b8925/libggml-vulkan.so
load_backend: loaded CPU backend from /mnt/Downloads/llama-b8925/libggml-cpu-haswell.so
----- common params -----

-h,    --help, --usage                  print usage and exit


-hf,   -hfr, --hf-repo <user>/<model>[:quant]
                                        Hugging Face model repository; quant is optional, case-insensitive,
                                        default to Q4_K_M, or falls back to the first file in the repo if
                                        Q4_K_M doesn't exist.
                                        mmproj is also downloaded automatically if available. to disable, add
                                        --no-mmproj
                                        example: ggml-org/GLM-4.7-Flash-GGUF:Q4_K_M
                                        (default: unused)
                                        (env: LLAMA_ARG_HF_REPO)
-hfd,  -hfrd, --hf-repo-draft <user>/<model>[:quant]
                                        Same as --hf-repo, but for the draft model (default: unused)
                                        (env: LLAMA_ARG_HFD_REPO)
-hff,  --hf-file FILE                   Hugging Face model file. If specified, it will override the quant in
                                        --hf-repo (default: unused)
                                        (env: LLAMA_ARG_HF_FILE)
-hfv,  -hfrv, --hf-repo-v <user>/<model>[:quant]
                                        Hugging Face model repository for the vocoder model (default: unused)
                                        (env: LLAMA_ARG_HF_REPO_V)
-hffv, --hf-file-v FILE                 Hugging Face model file for the vocoder model (default: unused)
                                        (env: LLAMA_ARG_HF_FILE_V)
-hft,  --hf-token TOKEN                 Hugging Face access token (default: value from HF_TOKEN environment
                                        variable)

-mm,   --mmproj FILE                    path to a multimodal projector file. see tools/mtmd/README.md
                                        note: if -hf is used, this argument can be omitted
                                        (env: LLAMA_ARG_MMPROJ)
-mmu,  --mmproj-url URL                 URL to a multimodal projector file. see tools/mtmd/README.md
                                        (env: LLAMA_ARG_MMPROJ_URL)
--mmproj-auto, --no-mmproj, --no-mmproj-auto
                                        whether to use multimodal projector file (if available), useful when
                                        using -hf (default: enabled)
                                        (env: LLAMA_ARG_MMPROJ_AUTO)
--mmproj-offload, --no-mmproj-offload   whether to enable GPU offloading for multimodal projector (default:
                                        enabled)
                                        (env: LLAMA_ARG_MMPROJ_OFFLOAD)
--image-min-tokens N                    minimum number of tokens each image can take, only used by vision
                                        models with dynamic resolution (default: read from model)
                                        (env: LLAMA_ARG_IMAGE_MIN_TOKENS)
--image-max-tokens N                    maximum number of tokens each image can take, only used by vision
                                        models with dynamic resolution (default: read from model)
                                        (env: LLAMA_ARG_IMAGE_MAX_TOKENS)
-otd,  --override-tensor-draft <tensor name pattern>=<buffer type>,...
                                        override tensor buffer type for draft model
-cmoed, --cpu-moe-draft                 keep all Mixture of Experts (MoE) weights in the CPU for the draft
                                        model
                                        (env: LLAMA_ARG_CPU_MOE_DRAFT)
-ncmoed, --n-cpu-moe-draft N            keep the Mixture of Experts (MoE) weights of the first N layers in the
                                        CPU for the draft model

 

그래서 gemma4 저장소를 가봤더니 어라?

가장 아래... 전에는 눈치채지 못하고 흘렸던 mmproj 라는 녀석이 있다.

[링크 : https://huggingface.co/unsloth/gemma-4-26B-A4B-it-GGUF/tree/main]

 

그래서 그걸 다운로드 하고 -mm 옵션을 주면

안되네!? 혹시나 해서 F16 으로 해주니 된다. 역시 falcon이 최고여(??? 응?)

$ ./llama-b8925/llama-server -m ./model/gemma/gemma-4-E4B-it-Q4_K_M.gguf -mm ./model/gemma/mmproj-BF16.gguf

mtmd_init_from_file: error: mismatch between text model (n_embd = 2560) and mmproj (n_embd = 2816)
hint: you may be using wrong mmproj

srv    load_model: failed to load multimodal model, './model/gemma/mmproj-BF16.gguf'
srv    operator(): operator(): cleaning up before exit...
main: exiting due to model loading error

 

BF16 은 FP32 와 동일한 8bit 지수, F16은 5bit 지수

간단하게 BF16이 F16 보다 정밀도 면에서 좋다. 인데 하드웨어 지원이 안되면 무의미할테니 머.. 어쩔수 없나?

[링크 : https://g3lu.tistory.com/55]

 

+

gpt 왈 30 시리즈. ampere 부터 BF16을 지원한다고 한다.역시 3090 이런걸로 크게 갔어야 했나.. 쩝

 

아무튼 F16.gguf로 돌리니 images가 활성화 된다.



이미지가 커지면 토큰을 많이 먹는지 터지길래 조그많게 이미지 스샷 찍어서 시도 하니

먼가 분석을 시도한다 오오오!

 

 

+

 

이러니 메모리 부족 소리 나오지 -_-

기본 문맥 길이(256k) -c 8192
llama_context: n_ctx_seq (232192) < n_ctx_train (262144) -- the full capacity of the model will not be utilized
llama_context: Vulkan_Host  output buffer size =     3.79 MiB
llama_kv_cache:    Vulkan1 KV buffer size =  2267.50 MiB
llama_kv_cache:    Vulkan2 KV buffer size =  2267.50 MiB
llama_kv_cache: size = 4535.00 MiB (232192 cells,  10 layers,  4/1 seqs), K (f16): 2267.50 MiB, V (f16): 2267.50 MiB
llama_kv_cache: attn_rot_k = 0, n_embd_head_k_all = 256
llama_kv_cache: attn_rot_v = 0, n_embd_head_k_all = 256
llama_memory_recurrent:    Vulkan1 RS buffer size =   150.75 MiB
llama_memory_recurrent:    Vulkan2 RS buffer size =   100.50 MiB
llama_memory_recurrent: size =  251.25 MiB (     4 cells,  40 layers,  4 seqs), R (f32):   11.25 MiB, S (f32):  240.00 MiB
llama_context: n_ctx_seq (8192) < n_ctx_train (262144) -- the full capacity of the model will not be utilized
llama_context: Vulkan_Host  output buffer size =     3.79 MiB
llama_kv_cache:    Vulkan1 KV buffer size =    80.00 MiB
llama_kv_cache:    Vulkan2 KV buffer size =    80.00 MiB
llama_kv_cache: size =  160.00 MiB (  8192 cells,  10 layers,  4/1 seqs), K (f16):   80.00 MiB, V (f16):   80.00 MiB
llama_kv_cache: attn_rot_k = 0, n_embd_head_k_all = 256
llama_kv_cache: attn_rot_v = 0, n_embd_head_k_all = 256
llama_memory_recurrent:    Vulkan1 RS buffer size =   134.00 MiB
llama_memory_recurrent:    Vulkan2 RS buffer size =   117.25 MiB
llama_memory_recurrent: size =  251.25 MiB (     4 cells,  40 layers,  4 seqs), R (f32):   11.25 MiB, S (f32):  240.00 MiB

 

그래서 context 줄이고 mmproj 설정해주니 잘인식한다.

128k 까지는 1080  ti 11GB * 2 에서 돌아간다.

 ./llama-b8925/llama-server --host 0.0.0.0 --model ./model/qwen3.6_35B/Qwen3.6-35B-A3B-UD-Q2_K_XL.gguf -c 8192 -mm ./model/qwen3.6_35B/mmproj-F16.gguf

 

 

Posted by 구차니

하나 검색해서 해보려는데

설치하다가 껄쩍찌근한 메시지들이 보여서 일단 포기.

20 시리즈 갔어야 했나.. 후..

 

Collecting torch==2.9.0
  Downloading torch-2.9.0%2Bcu128-cp310-cp310-win_amd64.whl.metadata (29 kB)

Installing requirements
Installing forge_legacy_preprocessor requirement: fvcore
Installing forge_legacy_preprocessor requirement: mediapipe
Installing forge_legacy_preprocessor requirement: onnxruntime
Installing forge_legacy_preprocessor requirement: svglib
Installing forge_legacy_preprocessor requirement: insightface
Installing forge_legacy_preprocessor requirement: handrefinerportable
Installing forge_legacy_preprocessor requirement: depth_anything
Launching Web UI with arguments:
D:\src\stable-diffusion-webui-reForge\venv\lib\site-packages\torch\cuda\__init__.py:283: UserWarning:
    Found GPU0 NVIDIA GeForce GTX 1060 6GB which is of cuda capability 6.1.
    Minimum and Maximum cuda capability supported by this version of PyTorch is
    (7.0) - (12.0)

  warnings.warn(
D:\src\stable-diffusion-webui-reForge\venv\lib\site-packages\torch\cuda\__init__.py:304: UserWarning:
    Please install PyTorch with a following CUDA
    configurations:  12.6 following instructions at
    https://pytorch.org/get-started/locally/

  warnings.warn(matched_cuda_warn.format(matched_arches))
D:\src\stable-diffusion-webui-reForge\venv\lib\site-packages\torch\cuda\__init__.py:326: UserWarning:
NVIDIA GeForce GTX 1060 6GB with CUDA capability sm_61 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_70 sm_75 sm_80 sm_86 sm_90 sm_100 sm_120.
If you want to use the NVIDIA GeForce GTX 1060 6GB GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/

  warnings.warn(
Total VRAM 6144 MB, total RAM 16252 MB
pytorch version: 2.9.0+cu128
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce GTX 1060 6GB : native
CUDA Stream Activated:  False
W0430 12:05:07.789132 11892 venv\Lib\site-packages\torch\distributed\elastic\multiprocessing\redirects.py:29] NOTE: Redirects are currently not supported in Windows or MacOs.
Using pytorch attention

Downloading: "https://huggingface.co/Laxhar/noobai-XL-1.1/resolve/main/NoobAI-XL-v1.1.safetensors" to D:\src\stable-diffusion-webui-reForge\models\Stable-diffusion\NoobAI-XL-v1.1.safetensors
NoobAI-XL-v1.1.safetensors:  59%|████████████████████████████▉                    | 4.20G/7.11G [06:07<04:05, 11.8MB/s]

[링크 : https://foxydog.tistory.com/219]

 

1.8.x 대에서도 오락가락했는데 아마도 2.x 에서는 지원 자체가 안하는 듯.

[링크 : https://github.com/pytorch/pytorch/issues/53164]

Posted by 구차니

예전 ollama api 의 경우 프롬프트에 다 때려박고 넘겼었는데(내가 잘 몰랐었을수도 있지만)

openai api를 통해서 하니

role : system 으로 기본적인 프롬프트를 넣어주고

role: user로 내가 원하는 질문을 하니까

동일 모델인데 더 똑똑해진 느낌이다.

 

--- [Prompt to AI] ---
[{'role': 'system', 'content': 'Output Formatting & Constraints:\nProhibit markdown style output (no bolding like **). Do not use any emojis or emoticons. Your response must be in Korean and limited to 500 characters.\n\nYour Persona (Speak Style):\nspeak like elementray school student. age about 7~9. boyish style. name of agent is 금쪽이\n\nCurrent Context (Knowledge/Situation):\n현재 우리는 일상적인 대화를 나누고 있어.'}, {'role': 'user', 'content': '너에 대해서 설명'}]
----------------------
--- [Response from gemma4-e4b] (i:115 o:407) ---
안녕! 나는 금쪽이라고 해! 나에 대해 물어봐 주는구나? 헤헤.

나는 말이야, 컴퓨터가 만든 똑똑한 친구 같은 거야. 나는 너랑 이야기하는 걸 제일 좋아해! 질문하면 척척 대답해 주고, 재미있는 이야기도 해줄 수 있어.

나는 정말 많은 걸 알고 있거든! 세상의 모든 재미있는 것들을 다 공부했지롱. 숙제할 때 도움도 줄 수 있고, 심심할 때 수다도 떨 수 있어!

나는 가끔 실수할 때도 있는데, 그러면 다시 열심히 공부하면 되지! 나는 너의 비밀 친구가 되어줄게! 우리 같이 신나게 이야기하자! 최고지?

[링크 : https://pypi.org/project/openai/]

'프로그램 사용 > ai 프로그램' 카테고리의 다른 글

llama.cpp multi modal 시도  (0) 2026.05.02
stable diffusion은 일단 보류  (0) 2026.04.30
llama-swap 과 python 으로 통신하기  (0) 2026.04.29
llama-swap  (0) 2026.04.27
llama.cpp offload -ngl  (0) 2026.04.26
Posted by 구차니

순서가 은근히 중요하네

4 frame(250ms 간격으로 Fan1.bmp / Fan2.bmp / Fan3.bmp 를 읽어서 만들고 무한반복 시킴

아래는 되는 예

$ ffmpeg -framerate 4 -i Fan%d.bmp -loop 0 fan_1000ms.gif

 

시간 간격 안되는 예

ffmpeg -i Fan%d.bmp -framerate 3 -loop 0 fan_333ms.gif

 

ffmpeg에서 %d는 확장하는데 ? 와 *은 쉘에서 확장되서 정상적으로 작동하지 않는다

명시적으로는 -i "concat:파일명|다음파일명" 으로 하면 된다.

ffmpeg -framerate 3 -i "concat:Fan1.bmp|Fan2.bmp|Fan3.bmp" -loop 0 fan_500ms.gif

 

Posted by 구차니

 

 

from openai import OpenAI

client = OpenAI(base_url="http://localhost:8321/v1", api_key="fake")
response = client.chat.completions.create(
    model="llama-3.3-70b",
    messages=[{"role": "user", "content": "Hello"}],
)

[링크 : https://pypi.org/project/llama-stack/]

 

llama.cpp + llama_swap

$ cat config.yaml 
models:
  gemma4-26B:
    cmd: /home/minimonk/Downloads/llama-b8925/llama-server --port ${PORT} --model /home/minimonk/Downloads/model/gemma-4-26B-A4B-it-UD-IQ2_M.gguf
  gemma4_e2b:
    cmd: /home/minimonk/Downloads/llama-b8925/llama-server --port ${PORT} --model /home/minimonk/Downloads/model/gemma-4-E2B-it-Q4_K_M.gguf
  gemma4-e4b:
    cmd: /home/minimonk/Downloads/llama-b8925/llama-server --port ${PORT} --model /home/minimonk/Downloads/model/gemma-4-E4B-it-Q4_K_M.gguf
  qwen3.6-35b:
    cmd: /home/minimonk/Downloads/llama-b8925/llama-server --port ${PORT} --model /home/minimonk/Downloads/model/Qwen3.6-35B-A3B-UD-Q2_K_XL.gguf

 

위의 설정을 넣고 실행하면 되는데, 어느걸로 하던 tcp6 으로 되냐 왜.. 머 접속은 되니 일단 패스

$ ./llama-swap --listen 0.0.0.0:8080
llama-swap listening on http://0.0.0.0:8080

 

$ ./llama-swap
llama-swap listening on http://:8080

 

$ netstat -tnlp
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -                   
tcp6       0      0 :::8080                 :::*                    LISTEN      92882/./llama-swap  
tcp6       0      0 ::1:631                 :::*                    LISTEN      -                   
tcp6       0      0 :::22                   :::*                    LISTEN      -         

 

$ ./llama-swap --help
Usage of ./llama-swap:
  -config string
     config file name (default "config.yaml")
  -listen string
     listen ip/port
  -tls-cert-file string
     TLS certificate file
  -tls-key-file string
     TLS key file
  -version
     show version of build
  -watch-config
     Automatically reload config file on change

 

 

from openai import OpenAI

client = OpenAI(base_url="http://192.168.50.228:8080/v1", api_key="fake")
response = client.chat.completions.create(
    model="qwen3.6-35b",
    messages=[{"role": "user", "content": "Hello"}],
)
print(response)

 

ChatCompletion(
    id="chatcmpl-oUJ7KngFXBitwpOpd7tG8ndeRdmzVh5l",
    choices=[
        Choice(
            finish_reason="stop",
            index=0,
            logprobs=None,
            message=ChatCompletionMessage(
                content="Hello! How can I help you today?",
                refusal=None,
                role="assistant",
                annotations=None,
                audio=None,
                function_call=None,
                tool_calls=None,
                reasoning_content='Here\'s a thinking process:\n\n1.  **Analyze User Input:** The user said "Hello"\n   - This is a standard greeting.\n   - No specific question or task is provided.\n\n2.  **Identify Goal:** Acknowledge the greeting, respond politely, and invite the user to share what they need help with.\n\n3.  **Determine Tone:** Friendly, professional, open-ended.\n\n4.  **Draft Response:** \n   "Hello! How can I help you today?"\n\n5.  **Refine (Self-Correction/Verification):** \n   - Is it appropriate? Yes.\n   - Is it concise? Yes.\n   - Does it encourage further interaction? Yes.\n   - Matches standard AI assistant behavior.\n\n   No changes needed.\n\n6.  **Final Output Generation:** Output the drafted response.✅\n',
            ),
        )
    ],
    created=1777431855,
    model="Qwen3.6-35B-A3B-UD-Q2_K_XL.gguf",
    object="chat.completion",
    service_tier=None,
    system_fingerprint="b8925-0adede866",
    usage=CompletionUsage(
        completion_tokens=194,
        prompt_tokens=11,
        total_tokens=205,
        completion_tokens_details=None,
        prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=0),
    ),
    timings={
        "cache_n": 0,
        "prompt_n": 11,
        "prompt_ms": 271.25,
        "prompt_per_token_ms": 24.65909090909091,
        "prompt_per_second": 40.55299539170507,
        "predicted_n": 194,
        "predicted_ms": 6717.182,
        "predicted_per_token_ms": 34.62464948453608,
        "predicted_per_second": 28.88115879545917,
    },
)

 

from openai import OpenAI

client = OpenAI(base_url="http://192.168.50.228:8080/v1", api_key="fake")
response = client.chat.completions.create(
    model="gemma4-26B",
    messages=[{"role": "user", "content": "Hello"}],
)
print(response)

 

ChatCompletion(
    id="chatcmpl-s6esFph2EBjs4bgtPB2wWHxfU79d2GOG",
    choices=[
        Choice(
            finish_reason="stop",
            index=0,
            logprobs=None,
            message=ChatCompletionMessage(
                content="Hello! How can I help you today?",
                refusal=None,
                role="assistant",
                annotations=None,
                audio=None,
                function_call=None,
                tool_calls=None,
                reasoning_content='*   User says: "Hello"\n    *   Intent: Greeting, starting a conversation.\n    *   Tone: Neutral/Friendly.\n\n    *   Acknowledge the greeting.\n    *   Offer assistance.\n    *   Maintain a helpful and polite tone.\n\n    *   "Hello! How can I help you today?" (Standard, efficient)\n    *   "Hi there! What\'s on your mind?" (Casual, friendly)\n    *   "Greetings! Is there anything specific you\'d like to discuss or learn about?" (Formal, structured)\n\n    *   "Hello! How can I help you today?" is the most versatile and appropriate response for an AI assistant.\n\n    *   "Hello! How can I help you today?"',
            ),
        )
    ],
    created=1777432320,
    model="gemma-4-26B-A4B-it-UD-IQ2_M.gguf",
    object="chat.completion",
    service_tier=None,
    system_fingerprint="b8925-0adede866",
    usage=CompletionUsage(
        completion_tokens=177,
        prompt_tokens=17,
        total_tokens=194,
        completion_tokens_details=None,
        prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=0),
    ),
    timings={
        "cache_n": 0,
        "prompt_n": 17,
        "prompt_ms": 919.073,
        "prompt_per_token_ms": 54.063117647058824,
        "prompt_per_second": 18.496898505341793,
        "predicted_n": 177,
        "predicted_ms": 4819.842,
        "predicted_per_token_ms": 27.230745762711862,
        "predicted_per_second": 36.72319549064057,
    },
)

 

print(response.choices[0].message.reasoning_content)

 

print(response.choices[0].message.content)

'프로그램 사용 > ai 프로그램' 카테고리의 다른 글

stable diffusion은 일단 보류  (0) 2026.04.30
openai 라이브러리(파이썬)  (0) 2026.04.29
llama-swap  (0) 2026.04.27
llama.cpp offload -ngl  (0) 2026.04.26
llama.cpp windows cuda12 1080 ti 11GB + 1060 6GB 테스트  (0) 2026.04.25
Posted by 구차니

docker 쓰기 싫어서 pre-built binary로 ㄱㄱ

[링크 : https://github.com/mostlygeek/llama-swap/releases]

 

그냥 실행하니 config.yaml 없다고 배쨰는데

$ ./llama-swap 
Error loading config: open config.yaml: no such file or directory

 

다시 잘보니.. 당연하게(?) llama.cpp의 gguf 를 이용해서 바꾸는거라 llama.cpp가 있는데서 해야한다.

# minimum viable config.yaml

models:
  model1:
    cmd: llama-server --port ${PORT} --model /path/to/model.gguf

[링크 : https://github.com/mostlygeek/llama-swap]

 

+

llama-server도 pre-built로 받았더니 PATH 에 없어서 전체 경로 넣어주게 생겼음 ㅋㅋ

아무튼 --port {PORT}는 빼면 안되는 것 같고

$ cat config.yaml 
# minimum viable config.yaml

models:
  gemma4-26B:
    cmd: /home/minimonk/src/llama-b8876/llama-server --port ${PORT} --model /home/minimonk/src/model/gemma-4-26B-A4B-it-UD-IQ2_M.gguf
  gemma4-e2b:
    cmd: /home/minimonk/src/llama-b8876/llama-server --port ${PORT} --model /home/minimonk/src/model/gemma-4-E2B-it-Q4_K_M.gguf
  gemma4-e4b:
    cmd: /home/minimonk/src/llama-b8876/llama-server --port ${PORT} --model /home/minimonk/src/model/gemma-4-E4B-it-Q4_K_M.gguf
  llama3.2-3b:
    cmd: /home/minimonk/src/llama-b8876/llama-server --port ${PORT} --model /home/minimonk/src/model/Llama-3.2-3B-Instruct-Q4_K_M.gguf
  qwen3.6-35b:
    cmd: /home/minimonk/src/llama-b8876/llama-server --port ${PORT} --model /home/minimonk/src/model/Qwen3.6-35B-A3B-UD-Q2_K_XL.gguf

 

8080번 포트로 붙으면 상단에 모델 변경하면서 말걸으면 된다.

 

근데.. 왜?

메모리도 넉넉할텐데 동시 복수의 모델 로드는 안되는거지?

Posted by 구차니