LearnWeb Taiwan
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    --- tags: 科技資訊, 技術小白 --- <script type="text/javascript" src="https://cdnjs.buymeacoffee.com/1.0.0/button.prod.min.js" data-name="bmc-button" data-slug="LearnWebTaiwan" data-color="#FFDD00" data-emoji="" data-font="Poppins" data-text="贊助社群營運" data-outline-color="#000000" data-font-color="#000000" data-coffee-color="#ffffff" ></script> # Google Colab - 只要五分鐘,技術小白也能自己架出雲端算圖服務 在 Midjourney 橫空出世後,結合許多名人的推廣,運算產圖技術已經慢慢開始擴展到普羅大眾之間,而這類 AICG(AI Generated Content) 相關的服務也相繼出爐!然而你有想過自己也能架出一個類似的服務平台出來嗎? ![](https://i.imgur.com/xFkkE6c.png) <p style="text-align:center">(結合 Discord 介面的 Midjourney 雲端算圖服務)</p> ## Stable Diffusion 與 Google Colab 先前,若我們想自己架設類似像 Midjourney 這一類的算圖服務,我們會需要安裝類似像 Stable Diffusion 這一類的文字轉換圖像生成模型,接著透過使用者電腦本身的 GPU 來進行運算,然而在安裝的過程中除了需要一些技術知識外,也蠻要求硬體設備,設備太差的話跑出來的效果不是不好就是運算需要花費一段時間才能產出圖片。若我們只是想試試看效果不想花太多在設備上的預算要怎麼辦?這時我們就可以使用 Google Colab 來進行雲端運算! Google Colab 是由 Google 所提供的免費雲端服務,它提供一個簡易的平台可以直接在網頁上編寫與執行程式碼,重點是允許使用者以筆記本的方式建立與共享程式碼,也就是說只要有人建立好一套能在雲端上運行的算圖服務的 WebUI,我們就可以直接根據他的筆記本直接執行並建立一個暫時性的算圖站台! ## 尋找模型 而 Colab 筆記要到哪裡找呢?目前在 GitHub 上有個專案 [stable-diffusion-webui-colab](https://github.com/camenduru/stable-diffusion-webui-colab) 專門就是在收集各個大神所提供的 colab 筆記,我們可以省下非常多的時間,只要從中挑選合適的模型並放置到 Google Colab 上就能馬上執行! 首先第一件事情就是找到我們需要的模型,這裡提供幾個選項可讓你選擇: - `chillout_mix_webui_colab`:偏向運算運算亞洲人臉孔的圖片 - `cinematic_diffusion_webui_colab`:運算比較偏向電影場景會出現具有鏡頭感的圖片(景深效果等等) - `food_crit_webui_colab`:如果你對於食物變身成怪物或是物品那種感興趣的則強烈推薦這個! 而找到你要的模型之後,該專案提供了三種選項供選擇: ![](https://i.imgur.com/8jhP0Di.png) 這三種選項差異主要是在 WebUI 上介面提供了不同功能,基本上大同小異,那我們先以中間 `stable` 這個穩定版按鈕為主,輕輕點下去後,你就會看到 Google Colab 的畫面了: ![](https://i.imgur.com/za59SpA.png) ## 載入筆記並運行 再看到上方畫面後,可以點選左上角的播放按鈕即可執行筆記指令,這時可能會要求你登入 Google 會員才能繼續使用: ![](https://i.imgur.com/c9nMr5A.png) 點完之後,他就會開始在筆記的下方顯示當下運行指令的結果,過程依據每個模型不同大約會需要等 3-5 分鐘,最後運行完畢時,會在指令最後生成一個公開的網址如下圖所示: ![](https://i.imgur.com/J4gbVeU.png) <p style="text-align:center">(看到 Public WebUI Colab URL 就算完成了!)</p> 而這個網址便是 Google Lab 在執行筆記所提供的指令後根據模型所建立起的 WebUI 介面,這時你就可以點進這個生成網址來連到你的服務站台,而服務站台以目前我使用的版本開起來會像這個樣子: ![](https://i.imgur.com/WZU0YTi.png) 上方提供非常多算圖服務的選項,舉凡像是常見的: - txt2img:文生圖,給一段文字生成符合情境的圖 - img2img:圖生圖,給一張圖片運算出另外一張圖 - 那當然還有其他相關的功能這裡就不贅述請大家自行摸索! 這裡以 txt2img 為例,介面中上方可以在 Prompt 詞彙中輸入你想產生圖片的情境,以英文為主;除此之外,如果你有一些想避免生成的東西則可以輸入在下方的 Negtive Prompt 當中,這樣一來就可以盡可能的產出你心目中想要的圖片: ![](https://i.imgur.com/wJYlYlS.png) 輸入完後再點選右上方的 Generate 這時就會開始運算圖片了,完成後會顯示在右下方: ![](https://i.imgur.com/fQmBqd9.png) 這時你可以點擊該照片來保存,或甚至是點選 Send to img2img 中進行加工等等功能。 ![](https://i.imgur.com/BTi3FYo.png) 那以這張為例子的話就使採用 `cinematic_diffusion_webui_colab` 模型,Prompt 詞為 `cat, walking on the street` 的結果。 484 既簡單又有趣呢?趕快親自試試看自己吧! <p style="text-align:center">--End--</p> {%hackmd H18MwJyDTk-tZXoBgxht0Q %}

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully