Skip to content

rkuo2000/GenAI

Repository files navigation

Generative AI

生成式人工智慧職缺

AI 教材
AIGC 教材
GenAI-projects 教材

PC軟體安裝
範例程式: git clone https://github.com/rkuo2000/GenAI


1. Text-to-Image

Image Creators

SD 3.5

ComfyUI Now Supports Stable Diffusion 3.5!


SwapFace online tools

  1. https://www.ismartta.com/
  2. https://www.vidwud.com/free-face-swap.html
  3. https://aifaceswap.io/#face-swap-playground
  4. https://remaker.ai/face-swap-free/
  5. https://www.swapface.org/


ComfyUI


Flux1-dev-fp8 model files

git clone https://github.com/comfyanonymous/ComfyUI
cd ComfyUI
mv ~/Downloads/flux1-dev-fp8.safetensors ~/ComfyUI/models/unet/
mv ~/Downloads/t5xxl_fp8_e4m3fn.safetensors ~/ComfyUI/models/clip/
mv ~/Downloads/clip_l.safetensors ~/ComfyUI/models/clip/
mv ~/Downloads/ae.safetensors ~/ComfyUI/models/vae/
python main.py
  1. open Browser at http:127.0.0.1:8188

  2. drag flux_dev_fp8_example.png to browser window to generate the work-flow chart

  1. edit text in CLIP Text Encode (Positive Prompt)
  1. click Queue Prompt to generate image

examples:

pretty Asian woman was holding the flowers in her hands, Korean Model, real photo style, full body shot.

One girl, long hair, model, white background, white shirt, khaki Capri pants, khaki loafers, sitting on a stool, lazy pose, slightly tilting head, smiling, Asian beauty, loose-ting clothes, inting clothes , slightly raised foot, half-body shot, Canon R5 camera style, blurred background, indoor, natural light, some sunlight shining on the face,9 : 16.

  • 建築設計提示詞
A modern office building design with 6 floors. The design language of the building is organic volume, curve design elements, natural leave or flower symbols.


WebUI


Krita

安裝與 ComfyUI 工作流匯入(建築景觀與室內設計應用)

FLUX.1[dev]模型在Krita完美整合


2. Text-to-3D

gTranslate + SDXL-Lightning + TripoSR + Blender


Image-to-3D


Kaggle: https://www.kaggle.com/code/rkuo2000/triposr


Depth Pro

Code: https://github.com/apple/ml-depth-pro Kaggle: https://www.kaggle.com/code/rkuo2000/depth-pro


3. Text-to-Video





SV4D
SV4D was trained to generate 40 frames (5 video frames x 8 camera views) at 576x576 resolution


Gen-3 Alpha Prompting Guide






4. Text-to-Avatar

GAN 教材

sample

Tutorial

Tutorial

Demo


ComfyUI-MuseTalk

musk_musetalk.mp4


Charactor Builder


5. Text-to-Song


Demucs

Paper: Music Source Separation in the Waveform Domain
Code: facebookresearch/demucs
Kaggle: https://www.kaggle.com/code/rkuo2000/demucs


RVC vs SoftVC

"Retrieval-based Voice Conversion" 和 "SoftVC VITS Singing Voice Conversion" 是兩種聲音轉換技術的不同變種。以下是它們之間的一些區別:

1.方法原理:
Retrieval-based Voice Conversion:這種方法通常涉及使用大規模的語音資料庫或語音庫,從中檢索與輸入語音相似的聲音樣本,並將輸入語音轉換成與檢索到的聲音樣本相似的聲音。它使用檢索到的聲音作為目標來進行聲音轉換。
SoftVC VITS Singing Voice Conversion:這是一種基於神經網路的聲音轉換方法,通常使用變分自動編碼器(Variational Autoencoder,VAE)或其他神經網路架構。專注於歌聲轉換,它的目標是將輸入歌聲樣本轉換成具有不同特徵的歌聲,例如性別、音調等。

2.應用領域:
Retrieval-based Voice Conversion 通常用於語音轉換任務,例如將一個人的語音轉換成另一個人的語音。它也可以用於歌聲轉換,但在歌聲轉換方面通常不如專門設計的方法表現出色。
SoftVC VITS Singing Voice Conversion 主要用於歌聲轉換任務,特別是針對歌手之間的音樂聲音特徵轉換,例如將男性歌手的聲音轉換成女性歌手的聲音,或者改變歌曲的音調和音樂特徵。

3.技術複雜性:
Retrieval-based Voice Conversion 的實現通常較為簡單,因為它主要依賴於聲音樣本的檢索和聲音特徵的映射。
SoftVC VITS Singing Voice Conversion 更複雜,因為它需要訓練深度神經網路模型,可能需要大量的數據和計算資源。


RVC WebUI


GPT-SoVITS

Blog: GPT-SoVITS 用 AI 快速複製你的聲音,搭配 Colab 免費入門
Code: https://github.com/RVC-Boss/GPT-SoVITS/
Kaggle: https://www.kaggle.com/code/rkuo2000/so-vits-svc-5-0


6. Text-to-Speech

  • python gTTS.py "How are you" en : generate gTTS.mp3

  • python gT2T.py "How are you" fr : deep-translator

  • python gSpeak.py "How are you" fr : deep-translator, gTTS & Mpg123

  • Parler TTS: python parler.py

  • Bark TTA: python bark_en.py, python bark_cn.py

  • Coqui TTS: python coqui_en.py, python coqui_zh.py

  • text-to-speech: python text_to_speech.py

  • gTTS: python gTTS.py "你好?" zh

  • gTranslate: python gTranslate.py


7. Audio-to-Text (ASR)

webkitSpeechRecognition

Blog: 語音辨識API

asr.html

Google Speech Demo


Whisper


local ASR+LLM Server running on GPU

  1. run server on local PC (with GPU): python whisper_llm_server.py
  2. Generate audio file: python ../gTTS.py "Hello, how are you?" en
  3. Post Audio to Server: python post_audio.py

8. Text-to-Text (LLMs)

Large Language Models 教材
Prompt Engineering 教材

git clone https://github.com/rkuo2000/GenAI
cd GenAI/Text-to-Text

  • python gpt4free.py (gpt-3.5-turbo)
  • python gpt4all_prompting.py
  • python LLM_prompting.py
  • colab_LLM_prompting.ipynb (on Colab T4)

local LLM Server & Client

  • python llm_server.py (on GPU)
  • python post_text.py (on PC)

Colab running LLM Server


Colab running ASR+LLM Server

  1. Open colab to run pyngrok_Whisper_LLM_Server.ipynb on Colab T4
  2. Generate audio file: python ../gTTS.py "Hello, how are you?" en
  3. Post Audio to Server: python post_audio.py

ollama list
ollama run llama3.2
ollama run tinyllama

ollama chat/generate

  • python ollama_chat.py
  • python ollama_stream.py (print text in streaming mode)
  • python ollama_curl.py

ollama speak

  • python ollama_speak.py (ollama generated text, gTTS to speech, then mpg123 to speak)
  • python ollama_speak_t2t.py (ollama generated text, gTTS to speech, deep-translator to zh-TW, mpg123 to speak)


get Gemini API Key



MIT App Inventor 2 example for using Google Gemini

(三星手機使用三星文字轉語音引擎應用程式, 語言設繁體中文會講不出話, 要改成簡體中文, 或使用英文)


9. LLM Fine-Tuning

LLM Fine-Tuning 教材

PEFT

fine-tune-gemma-7b-it-for-sentiment-analysis
fine-tune-llama-3-for-sentiment-analysis

LoRA

fine-tune-gemma-models-in-keras-using-lora

exmaples


10. Image-to-Text (VLM)

VLM 教材


examples


VLM servers

For running server, (use one of the following)

  1. python llava_server.py
  2. python llava_next_server.py
  3. python phi3-vision_server.py

For running client, (post image & text to VLM server)
python post_imgtxt.py images/barefeet1.jpg


ASR + VLM servers

  1. python whisper_llava_server.py
  2. python ../gTTS.py "這是什麼有名的台南美食?" zh (TTS)
  3. python post_imgau.py (client)

  • python gemini_image.py
  • python gemini_jpg2csv.py

11. RAG

RAG 教材

Sampe Codes



12. Agent

Agent 教材

Kaggle: rkuo2000/swarm-llama3-groq
Colab: colab_Swarm_Llama3_Groq.ipynb


參考書籍

  • 中二技能翻譯
    這是一個 LangChain 練習專案,透過 LLM 結合 Riot API 取得的英雄技能翻譯,以 Few-Shot Prompt 的方式獲得中二的技能翻譯。

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published