公司網(wǎng)站設(shè)計(jì)怎么做b站視頻推廣怎么買
從桌面壁紙到AI繪畫
一、前言
1.1 確認(rèn)問題
由于生活和工作需要,小編要長(zhǎng)時(shí)間的使用電腦,小編又懶,一個(gè)主題用半年的那種,所以桌面壁紙也是處于常年不更換的狀態(tài)。即時(shí)改變主題也是在微軟自帶的壁紙中選擇,而這些自帶的壁紙?jiān)缇鸵呀?jīng)看膩了。于是,問題產(chǎn)生了:如何讓電腦自動(dòng)變更自己喜歡的壁紙?
經(jīng)過思考,大致可以有2個(gè)方案:
方案一:通過下載壁紙軟件,讓壁紙軟件自動(dòng)切換
方案二:下載壁紙后保存到本地,通過系統(tǒng)自動(dòng)切換
二、方案一:通過壁紙軟件自動(dòng)更換
在網(wǎng)上找尋一通后,發(fā)現(xiàn)有幾款壁紙軟件挺不錯(cuò)的。比如:元?dú)庾烂?、飛火動(dòng)態(tài)壁紙、UPUPOO動(dòng)態(tài)桌面。但是經(jīng)過試用,發(fā)現(xiàn)該方案還是有不如人意的地方:
1、這些壁紙軟件在沒有購(gòu)買成為會(huì)員之前,大部分圖片都不能下載作為壁紙,并且大部分只能按月購(gòu)買會(huì)員,費(fèi)用還不低(十幾元~幾十元/月不等)。Steam上大名鼎鼎的wallpaper engine壁紙軟件才19元,而且是終生。不知道這些國(guó)產(chǎn)壁紙軟件憑啥賣這么貴。
2、僅有元?dú)庾烂姹诩堒浖峁┝擞嗛喒δ?選擇喜歡的類型或風(fēng)格),其它壁紙軟件不支持。
雖然該方案的不太適合,但是該說不說。這些壁紙軟件里有些圖片還是很不錯(cuò)的,有真人圖、二次元圖、AI圖:
三、方案二:直接下載壁紙,通過系統(tǒng)自動(dòng)切換
1、找到壁紙網(wǎng)站,最好符合以下優(yōu)點(diǎn):
- 資源多
- 質(zhì)量高
- 免費(fèi)、無版權(quán)
- 無水印
- 易下載
- 速度快
- 風(fēng)格多、題材多、類型豐富
- 可篩選
- 免注冊(cè)和登錄
2、找到想要的圖片,點(diǎn)擊下載到本地電腦上。保存到單獨(dú)的文件夾中。
3、進(jìn)入Windows設(shè)置\個(gè)性化:
4、在背景
處選擇幻燈片放映
:
5、點(diǎn)擊瀏覽
選擇之前用來存放下載后的壁紙文件夾。
6、此時(shí)在下方可以看到幻燈片放映
的相關(guān)設(shè)置,可以設(shè)置圖片切換頻率
、是否無序播放
、契合度推薦選擇填充。
7、設(shè)置完成。接下來,系統(tǒng)會(huì)每隔一段時(shí)間在目標(biāo)文件夾中挑選一張圖片作為壁紙。也可以在桌面上手動(dòng)切換,方法就是右鍵后,在彈出的菜單中點(diǎn)擊下一個(gè)桌面背景
。如下:
3.1 自動(dòng)下載壁紙
方案二雖然不錯(cuò),但是需要手動(dòng)下載壁紙,還是比較麻煩的。于是,打算通過Python自動(dòng)批量下載,省時(shí)省力(人生苦短,我用Python)。
由于是要從網(wǎng)站上下載圖片,那么一般是使用requests或selenium庫。小編這里采用的是selenium庫。再結(jié)合多線程,10幾分鐘也就下載好了目標(biāo)網(wǎng)站上的所有想要的3000多張壁紙。
# Encoding: utf-8
# Author: 思必得
# Date: 2023/9/20 16:36
# Project name: 下載圖片
# IDE: PyCharm
# File name: 下載圖片.py
# Python required version:未指定
# 模塊說明:
"""
從指定的圖片網(wǎng)站上下載壁紙圖片
"""
# 導(dǎo)入模塊:
from selenium.webdriver.common.by import By
from mdBrowser import csBrowserBySelenium
from mdTools import ftSoundBeep
from threading import Thread
from tqdm import trange
import requests
import time
import re
import os
# 更新日志:
"""
1、2023/9/20:a、創(chuàng)建文件
"""
# 待修改:
"""
"""
csbbs = csBrowserBySelenium()class DownloadPic:def __init__(self):self.headers = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36','Referer': '圖片網(wǎng)站',}self.pic_urls = [] # 初始pic地址self.pic_urls_api = [] # 重定向后的完整pic地址(帶參數(shù))def get_pic_url(self):el_next = csbbs.mtElIsExist('//*[@id="app"]/div[1]/main/div/div/div/div[5]/div/div/div/div/div[1]/div[2]')div = csbbs.mtElIsExist('//*[@id="app"]/div/main/div/div/div/div[4]')divs = div.find_elements(by=By.CLASS_NAME, value='img-box')for div in divs:a = div.find_element(By.CLASS_NAME, value='down-span').find_element(By.TAG_NAME, value='a')self.pic_urls.append(a.get_attribute('href'))el_next.click()time.sleep(3)def get_pic_api_th(self, url):r = requests.get(url=url, headers=self.headers, allow_redirects=False) # 禁用重定向self.pic_urls_api.append(r.headers['Location'])def download_pic_th(self, url):r = requests.get(url=url, headers=self.headers)pic_name = os.path.join(r'G:\資源素材\壁紙\zzzmh', re.split(r'[?/]', url)[5])with open(pic_name, 'wb') as f:f.write(r.content)def main(self):"""通過翻頁獲取到每頁每張圖片的初始地址"""for _ in trange(112):self.get_pic_url()"""通過圖片的初始地址獲取到圖片的完整地址"""self.pic_urls_api = []ths = []for _ in self.pic_urls:th = Thread(target=self.get_pic_api_th, args=(_,))ths.append(th)th.start()for th in ths:th.join()self.pic_urls = []"""通過圖片的完整地址下載到本地電腦"""for _ in self.pic_urls_api:th = Thread(target=self.download_pic_th, args=(_,))ths.append(th)th.start()for th in ths:th.join()ftSoundBeep()if __name__ == '__main__':dp = DownloadPic()dp.main()
注意事項(xiàng):
在多線程爬取時(shí),一定要注意等待,不要一次太快爬取太多,否則容易被阻止訪問。
效果如下:
四、方案三:AI繪畫
4.1 引言
無論是壁紙軟件也好,壁紙網(wǎng)站也好,發(fā)現(xiàn)有很多都是AI制作的壁紙,而且質(zhì)量還很高。于是,突發(fā)奇想,是否可以通過AI繪畫的形式,讓AI來直接繪制壁紙呢?
AI繪畫的優(yōu)勢(shì)很明顯,沒有版權(quán)問題,自由度高,定制化高。
于是小編便一頭扎進(jìn)了AI繪畫這個(gè)大坑之中。。。
總之是一言難盡,AI繪畫就是個(gè)大坑,期間查詢了很多資料,看了很多教程、文章、視頻。發(fā)現(xiàn)AI繪畫的水很深,一般人想要入坑了解、學(xué)習(xí)、掌握的門檻特別高。
不過,好在有簡(jiǎn)易入門使用的方法,現(xiàn)分享出來給大家。不過在此,需要先對(duì)AI繪畫有個(gè)初步的了解。
4.2 AI繪畫說明
如果我們要找別人繪畫,我們會(huì)先去找一個(gè)畫家,而每個(gè)畫家有不同的風(fēng)格,有的擅長(zhǎng)寫實(shí)、有的擅長(zhǎng)人物、有的擅長(zhǎng)二次元、有的擅長(zhǎng)風(fēng)景等等。而在AI繪畫中,不同的風(fēng)格就是模型
,你選擇不同的模型,就會(huì)導(dǎo)致AI繪畫時(shí)作出不同風(fēng)格的畫出來。
有了畫家
還不行,我們還需要告訴畫家
我們要畫一副什么畫,比如:我想畫一個(gè)中國(guó)年輕男人在一個(gè)夏天大雨過后在草地上騎馬奔馳的畫面。那么這里的一個(gè)
、中國(guó)
、年輕
、男人
、夏天
、大雨
、草地
、騎馬
等都是提示詞
。在AI繪畫中也稱為:標(biāo)簽
、Tag
、Prompt
,都是同一個(gè)意思。這就和你讓畫家畫畫一樣,給的提示詞越詳細(xì)、越具體,這個(gè)畫家就更容易畫出你想要的畫面。
當(dāng)然,提示詞有正面
和負(fù)面
之分。正面的就是我們想要出現(xiàn)在畫面中,而負(fù)面就是不想要出現(xiàn)在畫面中。
提示詞還有權(quán)重的區(qū)別,權(quán)重越大,這個(gè)提示詞提到的內(nèi)容占比就越大。
4.3 電腦配置要求
操作系統(tǒng):win10及以上
CPU:無強(qiáng)制要求
內(nèi)存:>8G
顯卡:獨(dú)立N卡,顯存>4G
4.4 實(shí)操步驟
1、下載B站秋葉大佬(人稱:賽博佛祖)的最新Stable Diffusion整合包v4.4
`整合包說明:`
所謂的整合包就是打包了運(yùn)行必須得Python、git環(huán)境,并且預(yù)置好模型,添加了一些常用的插件。
所有環(huán)境都可以在這個(gè)整合包內(nèi)隨用隨刪,環(huán)境是`獨(dú)立`且`虛擬`的,不會(huì)產(chǎn)生任何沖突。
比自己按照教程手動(dòng)部署不知道要方便了多少倍。不知道拯救了多少個(gè)像小編一樣在手動(dòng)部署中陷入痛苦與掙扎的人(一堆的報(bào)錯(cuò)。。。)??芍^功德無量。
2、將下載好的整合包解壓,最好放在固態(tài)硬盤中,可以加快運(yùn)行速度。
3、雙擊打開啟動(dòng)器運(yùn)行依賴-dotnet-6.0.11.exe
以安裝啟動(dòng)器運(yùn)行時(shí)需要的依賴。
4、進(jìn)入到sd-webui-aki-v4.1
(這里小編用的是v4.1版本),雙擊打開A啟動(dòng)器.exe
,主界面如下:
5、點(diǎn)擊右下角一鍵啟動(dòng)
:
6、等待片刻后會(huì)自動(dòng)在默認(rèn)瀏覽器中打開網(wǎng)站,進(jìn)入到AI繪畫的頁面中:
7、里面的內(nèi)容都是中文的,一切的配置都不需要?jiǎng)?。我們看到左上角可以選擇模型,使用自帶的sd-v1-4
模型即可。然后在正向提示詞和反向提示詞中填入你想要的即可。新手剛開始不知道要怎么填,這里,小編提供1組:
正向:
(photo photography), (Chinese girl), 1 girl, solo, beautiful, lovely, lifelike facial details, delicate facial features, long black hair, big chest, facing the audience, smile, powder blusher, delicate collarbone, pink skirt, big legs, slippers, interior, living room, huge sofa, tea table, fruit, banana, grape, pitaya, vase, flower arrangement, masterpiece, official art, 8K, CG rendering, complex details, (Photography: 1.1), (Gorgeous Chinese Women: 1.3), Instagram, (Photo Realism: 0.8)
反向:
bad anatomy, error, jpeg artifacts, low quality, lowres, normal quality, worst quality, fewer digits, extra digits, bad hands, bad feet, cropped, missing fingers, signature, text, username, watermark, futa
8、填寫后,點(diǎn)擊右側(cè)的生成
,等待程序完成即可。生成的速度和電腦配置,尤其是顯卡的配置有關(guān),一般要1分鐘及以上。
9、生成的圖片保存在:sd-webui-aki-v4.1\outputs\txt2img-images中。
好了,以上就是AI繪畫中,文生圖的基本用法??梢钥吹竭€是很簡(jiǎn)單的。這個(gè)AI程序還有更多的功能,比如:更換模型、圖生圖、后期處理、PNG圖片信息、圖片放大等等,大家可以自行去了解。
4.5 常用提示詞
Beautiful
Radiant
Elegant
Charming
Lovely
Graceful
Alluring
Stunning
Enchanting
Mesmerizing
Exquisite
Ravishing
Captivating
Bewitching
Gorgeous
Attractive
Fascinating
Delicate
Disarming
Winsome
Enticing
Poised
Sophisticated
Classy
Glamorous
Stylish
Fashionable
Trendy
Chic
Enigmatic
Mysterious
Intriguing
Dreamy
Sassy
Witty
Humorous
Fun-loving
Lively
Bubbly
Playful
Animated
Energetic
Dynamic
Ambitious
Driven
Confident
Independent
Strong-minded
Fearless
Bold
Daring
Adventurous
Bold
Spontaneous
Unpredictable
Creative
Artistic
Visionary
Innovative
Resourceful
Practical
Logical
Analytical
Intellectual
Smart
Witty
Clever
Sharp
Keen
Perceptive
Intuitive
Empathetic
Compassionate
Understanding
Attentive
Patient
Tolerant
Forgiving
Caring
Thoughtful
Kind-hearted
Generous
Charitable
Philanthropic
Helper
Selfless
Modest
Humble
Respectful
Trustworthy
Reliable
Loyal
Faithful
Honest
Sincere
Genuine
Authentic
Natural
Unassuming
Gracious
4.6 幾組模型及出圖
4.6.1 國(guó)風(fēng)
模型:guofeng3
提示詞:best quality,masterpiece,highres,1girl,blush,(seductive smile:0.8),star-shaped pupils,red china hanfu,hanfu,chinese clothes,hair ornament,necklace,jewelry,Beautiful face,upon_body,tyndall effect,photorealistic,dark studio,rim lighting,two tone lighting,(high detailed skin:1.2),8k uhd,dslr,soft lighting,high quality,volumetric lighting,candid,Photograph,high resolution,4k,8k,Bokeh,
反向提示詞:
(((simple background))),monochrome,lowres,bad anatomy,bad hands,text,error,missing fingers,extra digit,fewer digits,cropped,worst quality,low quality,normal quality,jpeg artifacts,signature,watermark,username,blurry,lowres,bad anatomy,bad hands,text,error,extra digit,fewer digits,cropped,worst quality,low quality,normal quality,jpeg artifacts,signature,watermark,username,blurry,ugly,pregnant,vore,duplicate,morbid,mut ilated,tran nsexual,hermaphrodite,long neck,mutated hands,poorly drawn hands,poorly drawn face,mutation,deformed,blurry,bad anatomy,bad proportions,malformed limbs,extra limbs,cloned face,disfigured,gross proportions,(((missing arms))),(((missing legs))),(((extra arms))),(((extra legs))),pubic hair,plump,bad legs,error legs,username,blurry,bad feet,
提示詞:
best quality,masterpiece,highres,cg,1girl,weapon,sword,long hair,dress,water,solo,jewelry,white dress,earrings,hair ornament,splashing,upper body,hair bun,black hair,lighting,candid,Photograph,high resolution,4k,8k,Bokeh,
反向提示詞:
(((simple background))),monochrome ,lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, lowres, bad anatomy, bad hands, text, error, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, ugly,pregnant,vore,duplicate,morbid,mut ilated,tran nsexual, hermaphrodite,long neck,mutated hands,poorly drawn hands,poorly drawn face,mutation,deformed,blurry,bad anatomy,bad proportions,malformed limbs,extra limbs,cloned face,disfigured,gross proportions, (((missing arms))),(((missing legs))), (((extra arms))),(((extra legs))),pubic hair, plump,bad legs,error legs,username,blurry,bad feet
提示詞:
best quality,masterpiece,highres,cg,1girl,long hair,dress,water,solo,jewelry,white dress,earrings,hair ornament,splashing,upper body,hair bun,black hair,lighting,candid,Photograph,high resolution,4k,8k,Bokeh,lora:moreDetails.5pEa:0.8,
反向提示詞:
(((simple background))),monochrome,lowres,bad anatomy,bad hands,text,error,missing fingers,extra digit,fewer digits,cropped,worst quality,low quality,normal quality,jpeg artifacts,signature,watermark,username,blurry,lowres,bad anatomy,bad hands,text,error,extra digit,fewer digits,cropped,worst quality,low quality,normal quality,jpeg artifacts,signature,watermark,username,blurry,ugly,pregnant,vore,duplicate,morbid,mut ilated,tran nsexual,hermaphrodite,long neck,mutated hands,poorly drawn hands,poorly drawn face,mutation,deformed,blurry,bad anatomy,bad proportions,malformed limbs,extra limbs,cloned face,disfigured,gross proportions,(((missing arms))),(((missing legs))),(((extra arms))),(((extra legs))),pubic hair,plump,bad legs,error legs,username,blurry,bad feet,
4.6.2 卡通風(fēng)
模型:QteaMix
提示詞:(masterpiece:1.2, best quality:1.2) , {fox girl} , {{fox ear}} , very long hair , grey hair , medium breasts , {{ miko }} ,black eyes ,((masterpiece)), (((best quality))), ((ultra-detailed)), ((illustration)), ((disheveled hair)) , solo , {japanese shrine} , perfect hand , perfect fingers ,{{{ japanese festival , night time }}}, smile , solo focus , lie down , lying
負(fù)面提示詞:
(worst quality, low quality, large head, extra digits:1.4), bad hands, mutated hand, (six or more fingers:1.7), (tangled fingers:1.3), complex fingers, (spindly fingers:1.3), broken fingers, missing fingers, text , monochrome
提示詞:
embarrassed blush @_@ covering wavy mouth,12-year-old girl with wavy red-brown hair, pink dress. Big blue eyes, rosy cheeks, and a white tail. Outfit includes a pink dress, black collar with cat medallion, sky blue ribbon with red heart,a large sky blue bow in one ear,small chest,sound effects
負(fù)面提示詞:
worst quality, large head, low quality, extra digits, bad eyes, EasyNegativeV2, ng_deepnegative_v1_75t
4.6.3 科幻風(fēng)
基底模型:SDXL 1.0
提示詞:
Hyperrealistic art BJ_Sacred_beast, red_eyes, outdoors, horns, sky, teeth, day, cloud, no_humans, cloudy_sky, scenery, smoke, mountain, dragon,cinematic lighting,strong contrast,high level of detail,Best quality,masterpiece,lora:SDXL_Sacred_beast:0.7, . Extremely high-resolution details, photographic, realism pushed to extreme, fine texture, incredibly lifelike
反向提示詞:
simplified, abstract, unrealistic, impressionistic, low resolution, embedding:BadDream,embedding:FastNegativeV2,
提示詞:
Hyperrealistic art skin gloss,light persona,(crystalstexture skin:1.2),(extremely delicate and beautiful),pov,(white_skin:1.2),1girl,solo,long_hair,bare shoulders,red_dress,skirt,(((wings,red_wings))),(full shot),looking_at_viewer,BJ_Sacred_beast,full body,run,suspension,outdoors,sky,day,cloud,fire,water,blue_sky,ocean,cloudy_sky,cinematic lighting,strong contrast,high level of detail,Best quality,masterpiece,lora:SDXL_Sacred_beast:0.7, . Extremely high-resolution details, photographic, realism pushed to extreme, fine texture, incredibly lifelike
反向提示詞:
simplified, abstract, unrealistic, impressionistic, low resolution, embedding:BadDream,embedding:FastNegativeV2,