国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Stable Diffusion 本地部署

這篇具有很好參考價(jià)值的文章主要介紹了Stable Diffusion 本地部署。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

注意:如果沒有顯卡或顯卡性能較弱的同學(xué)們不要嘗試,不然到最后也還是不行!當(dāng)然這些同學(xué)們可以去(免費(fèi),效果稍遜)
Stable Diffusion - a Hugging Face Space by stabilityaiDiscover amazing ML apps made by the communityhttps://huggingface.co/spaces/stabilityai/stable-diffusion

或者(收費(fèi),但是效果更好)

DreamStudioDreamStudio by Stability AI is a new AI system powered by Stable Diffusion that can create realistic images, art and animation from a description in natural language.https://beta.dreamstudio.ai/dream這兩個(gè)網(wǎng)站上過過癮。

本文主要參考 GitHub 上的使用描述

1. GitHub下載源碼包

GitHub - CompVis/stable-diffusion: A latent text-to-image diffusion modelA latent text-to-image diffusion model. Contribute to CompVis/stable-diffusion development by creating an account on GitHub.https://github.com/CompVis/stable-diffusion

git clone https://github.com/CompVis/stable-diffusion

2. 下載模型參數(shù)

下載地址:https://huggingface.co/CompVis

根據(jù)自己的需要下載(建議下載-original版本):如需要 stable-diffusion-v-1-1-original 版本,則直接點(diǎn)擊 stable-diffusion-v-1-1-original:

Stable Diffusion 本地部署

?再點(diǎn)擊 sd-v1-1.ckpt 下載即可(文件一般是以G為單位):

Stable Diffusion 本地部署

?3. anaconda創(chuàng)建 ldm 環(huán)境

不熟悉 anaconda 的同學(xué)可以參考其他博客,這里不再贅述。

(建議在stable-diffusion目錄下)打開命令行運(yùn)行下面代碼:

conda env create -f environment.yaml
conda activate ldm

如果已經(jīng)有 ldm 環(huán)境的同學(xué),也可以運(yùn)行下面代碼進(jìn)行內(nèi)部安裝包更新:

conda install pytorch torchvision -c pytorch
pip install transformers==4.19.2 diffusers invisible-watermark
pip install -e .

4. 設(shè)置模型參數(shù)存放位置

Linux系統(tǒng)的同學(xué)運(yùn)行下面代碼:

mkdir -p models/ldm/stable-diffusion-v1/
ln -s <path/to/model.ckpt> models/ldm/stable-diffusion-v1/model.ckpt 

其中 <path/to/model.ckpt>是你上面下載模型參數(shù)時(shí)的存放位置

如果不想使用命令行或Window的同學(xué)可以先在 models/ldm 下手動(dòng)創(chuàng)建 stable-diffusion-v1 文件夾,然后將剛才下載的模型參數(shù)改名為 model.ckpt 并放在?stable-diffusion-v1 目錄下

5. 運(yùn)行 stable-diffusion

在?stable-diffusion 目錄下運(yùn)行下面代碼(確保此時(shí)已經(jīng)激活了 ldm 環(huán)境):

python scripts/txt2img.py --prompt "a photograph of an astronaut riding a horse" --plms 

其中 --prompt 后面的即是描述性文字,可以根據(jù)需要更改(不要想著生成一些不好的東西,沒有用的)。

一些可以調(diào)節(jié)的參數(shù)如下:

usage: txt2img.py [-h] [--prompt [PROMPT]] [--outdir [OUTDIR]] [--skip_grid] [--skip_save] [--ddim_steps DDIM_STEPS] [--plms] [--laion400m] [--fixed_code] [--ddim_eta DDIM_ETA]
                  [--n_iter N_ITER] [--H H] [--W W] [--C C] [--f F] [--n_samples N_SAMPLES] [--n_rows N_ROWS] [--scale SCALE] [--from-file FROM_FILE] [--config CONFIG] [--ckpt CKPT]
                  [--seed SEED] [--precision {full,autocast}]

optional arguments:
  -h, --help            show this help message and exit
  --prompt [PROMPT]     the prompt to render
  --outdir [OUTDIR]     dir to write results to
  --skip_grid           do not save a grid, only individual samples. Helpful when evaluating lots of samples
  --skip_save           do not save individual samples. For speed measurements.
  --ddim_steps DDIM_STEPS
                        number of ddim sampling steps
  --plms                use plms sampling
  --laion400m           uses the LAION400M model
  --fixed_code          if enabled, uses the same starting code across samples
  --ddim_eta DDIM_ETA   ddim eta (eta=0.0 corresponds to deterministic sampling
  --n_iter N_ITER       sample this often
  --H H                 image height, in pixel space
  --W W                 image width, in pixel space
  --C C                 latent channels
  --f F                 downsampling factor
  --n_samples N_SAMPLES
                        how many samples to produce for each given prompt. A.k.a. batch size
  --n_rows N_ROWS       rows in the grid (default: n_samples)
  --scale SCALE         unconditional guidance scale: eps = eps(x, empty) + scale * (eps(x, cond) - eps(x, empty))
  --from-file FROM_FILE
                        if specified, load prompts from this file
  --config CONFIG       path to config which constructs model
  --ckpt CKPT           path to checkpoint of model
  --seed SEED           the seed (for reproducible sampling)
  --precision {full,autocast}
                        evaluate at this precision

也可以實(shí)現(xiàn)圖片轉(zhuǎn)換圖片,運(yùn)行下面代碼:文章來源地址http://www.zghlxwxcb.cn/news/detail-413138.html

python scripts/img2img.py --prompt "A fantasy landscape, trending on artstation" --init-img <path-to-img.jpg> --strength 0.8

到了這里,關(guān)于Stable Diffusion 本地部署的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • Ubuntu上AMD顯卡能夠使用的stable diffusion webui部署方案流程

    本文環(huán)境使用實(shí)體設(shè)備,顯卡是AMD RX6800XT。 系統(tǒng)是ubuntu20.04.5 LTS 桌面版,部署成功后也可以在評(píng)論區(qū)發(fā)出你的顯卡型號(hào)和系統(tǒng)。 非虛擬化環(huán)境。分個(gè)100G的分區(qū)安裝Ubuntu,可以與win共存!想用哪個(gè)系統(tǒng)就重啟切換!慢慢看,中間涉及git、pip安裝慢的可以裝個(gè)“開發(fā)者邊車”解

    2024年01月20日
    瀏覽(36)
  • Stable Diffusion云端部署流程與注意點(diǎn)

    在今天的大數(shù)據(jù)時(shí)代,AI繪圖是企業(yè)必備的重要工具之一。而Stable Diffusion作為一款部署的AI繪圖,得到了很多企業(yè)和團(tuán)隊(duì)的認(rèn)可。在使用Stable Diffusion的過程中,云部署是一個(gè)非常重要的話題,本文將詳細(xì)介紹Stable Diffusion云部署的流程以及注意點(diǎn)。 選擇云平臺(tái)? 首先,我們需

    2024年02月07日
    瀏覽(19)
  • Windows10完美安裝AI繪畫軟件stable-diffusion-webui:沒有GPU顯卡的電腦系統(tǒng)也能運(yùn)行、測(cè)試AI繪畫軟件【包教會(huì)一鍵安裝】
  • 本地部署Stable Diffusion

    本地部署Stable Diffusion

    報(bào)錯(cuò):RuntimeError:“LayerNormKernelImpl” not implemented for ‘Half 解決方案: 產(chǎn)生報(bào)錯(cuò)的原因是因?yàn)轱@卡不支持half-float的數(shù)據(jù)類型,所以在啟動(dòng)項(xiàng)set COMMANDLINE_ARGS=后增加這一句 --precision full --no-half,以后運(yùn)行webui-user.bat就可以了

    2024年02月11日
    瀏覽(24)
  • Stable Diffusion本地部署

    Stable Diffusion本地部署

    網(wǎng)絡(luò)很重要,安裝會(huì)因?yàn)槌瑫r(shí)失敗,我是失敗了很多次才成功 Windows10,N 卡(我的是古早的1070) 安裝conda,也可以安裝miniconda 進(jìn)入stable-diffusion-webui目錄 創(chuàng)建conda 虛擬環(huán)境 激活conda 環(huán)境 安裝依賴 安裝其他依賴 安裝好后終端會(huì)顯示服務(wù)以運(yùn)行 直接訪問域名,以上步驟安裝順利

    2024年02月09日
    瀏覽(31)
  • Stable Diffusion 本地部署

    Stable Diffusion 本地部署

    注意:如果沒有顯卡或顯卡性能較弱的同學(xué)們不要嘗試,不然到最后也還是不行!當(dāng)然這些同學(xué)們可以去(免費(fèi),效果稍遜) Stable Diffusion - a Hugging Face Space by stabilityai Discover amazing ML apps made by the community https://huggingface.co/spaces/stabilityai/stable-diffusion 或者(收費(fèi),但是效果更好) D

    2023年04月14日
    瀏覽(28)
  • Stable Diffusion本地部署教程

    Stable Diffusion本地部署教程

    0.介紹與版本 1)介紹 Stable Diffusion是一個(gè)文本到圖像的潛在擴(kuò)散模型,由CompVis、Stability AI和LAION的研究人員在Latent Diffusion Model的基礎(chǔ)上于2022年8月創(chuàng)建并推出。其核心技術(shù)源于AI視頻剪輯技術(shù)創(chuàng)業(yè)公司Runway的首席研究科學(xué)家Patrick Esser以及慕尼黑大學(xué)機(jī)器視覺學(xué)習(xí)組的Robin Rom

    2024年04月10日
    瀏覽(40)
  • Stable Diffusion 本地部署教程

    Stable Diffusion 本地部署教程

    最近看Stable Diffusion開源了,據(jù)說比Disco Diffusion更快,于是從git上拉取了項(xiàng)目嘗試本地部署了,記錄分享一下過程~ 這里是官網(wǎng)介紹:https://stability.ai/blog/stable-diffusion-public-release 科學(xué)上網(wǎng)。很多鏈接都需要用到。 顯卡的顯存需要足夠大,至于多大沒看到哪有說,反正3g絕對(duì)不行

    2023年04月11日
    瀏覽(29)
  • AMD顯卡 Ubuntu 部署Stable DIffusion WebUI基于Pytorch2.0.0 Rocm5.4.2

    AMD顯卡 Ubuntu 部署Stable DIffusion WebUI基于Pytorch2.0.0 Rocm5.4.2

    Ubuntu 20.04.6 LTS Python系統(tǒng)自帶3.8版本(雖然官方要求3.10.6,但是我3.8運(yùn)行沒發(fā)現(xiàn)問題) 顯卡RX6500XT 4G Navi24核心 官網(wǎng)下載安裝 在下載好的驅(qū)動(dòng)文件目錄,執(zhí)行安裝命令 先將源列表文件sources.list備份 打開sources.list文件 替換為國(guó)內(nèi)鏡像源,保存 這里我用阿里云的鏡像源 https://d

    2024年02月02日
    瀏覽(21)
  • Stable Diffusion/Win/本地部署

    Stable Diffusion/Win/本地部署

    一、本地部署 Stable Diffusion 前言 目前市面上比較權(quán)威,并能用于工作中的AI繪畫軟件其實(shí)就兩款。一個(gè)叫Midjourney(簡(jiǎn)稱MJ),另一個(gè)叫Stable-Diffusion(簡(jiǎn)稱SD)。MJ需要付費(fèi)使用,而SD開源免費(fèi),但是上手難度和學(xué)習(xí)成本略大,并且非常吃電腦配置(顯卡、內(nèi)存)。 E和Midjourne

    2024年01月16日
    瀏覽(24)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包