Hi this is Crody from Team-C
In this article, I'll explain how I use / create models using kaggle and how to setup the platform
Pros and Cons
Pros
Create great images without GPU
No nsfw filters
High speed generation
(For intermediate) Adding contrast, brightness and saturation filters using PIL
Cons
30hrs / week for usage
Requirement
A Phone
A little knowledge about Python (string must be in "", all things can be assigned after =)
Creativity
Account for CivitAI and Huggingface
1. Create account for Kaggle
Go to https://www.kaggle.com
Create account by pressing Register
You can create an account using your email or using google account
2. Verify your account
Go to your account profile and click on your Account and click “Edit Public Profile”.
Scroll down to “Phone Verification”, and click on the hyperlink: “Not Verified”.
In the dropdown menu for country code, select your country code, and proceed to fill in your phone number in the next box.
Once the phone number is sorted, check the CAPTCHA box to click the final button “Send verification code”
If you get a verification code, you can go ahead and finish up the verification process.
3. Get API for CivitAI and Huggingface
For CivitAI:
Go here https://civitai.com/user/account
Select "+ Add API key" under API Keys
Name your api and save it
Copy the api key to some text file
! Be sure to save this, you won't be able to see it again !
For HuggingFace:
Select "Access Tokens" in the menu on the left
Enter your account's password and click Confirm
Click on "+ Create new token"
Click on "Write", name your api and click "Create token"
Copy the api key to some text file
! Be sure to save this, you won't be able to see it again !
4. Create notebook for t2i
Create text file (.txt) using local software
Write down the text file like following:+model name that you want to use, link to the model
eg.)
+NF, https://civitai.com/models/503815/nova-furry-xl
Open and run the main.py inside MMS via IDLE
Select the text file you created via Planned Text Path
Write the VAE link
eg.) https://civitai.com/models/296576/sdxl-vaeFill in CivitAI API and HuggingFace API
Click on Save Plan as .ipynb
(If the button isn't showing, stretch the Model Planner window)Name your notebook and save it
5. Import / Setup the notebook on Kaggle
On kaggle, click on "+ Create" and select "Import Notebook"
Select the notebook you created after clicking Browse Files
Click on Import and after that, click on Edit
Click on the arrow on right bottom corner if the menu isn't displayed on right
In Session options, Select on ACCELERATOR and choose GPU T4 x2
Start Session and run first script
Run the second script and after that, run the fourth script which starts with #@title Pipe Config
In the Pipe Config, choose the sampler you want from SCHEDULER, find the sentence with scheduler = "choose from below list" and replace inside "" to the name of sampler you want
eg. If you want Euler A) scheduler = "euler_a"
For model type (precision), change after model_type = to the model's precision
eg. If the model is fp16) model_type = "fp16"If the model is safetensor, write "safetensors" after ext =
If not, write "ckpt"
The next script is for t2i
These are parameters that can be used in generation:
w / h : width and height
prompt: Prompt (write them inside "", if you want to use " in text, write \ before it)
global_seed: Seed for the generation, -1 for the random
neg: Negative Prompt (same as above)
hires_steps: Steps for the hires.fixhires_scale: Scaling factor for the hires.fix
hires: Whether you use hires.fix or not (if you want to use it, write True and if not, write False)
global_hires_seed: Seed for the hires.fix, -2 for the same value as seed, -1 for random
steps: Steps to use
guidance: CFG Scale
guidance_h: CFG Scale for hires.fix
denoise: Denoise strength for hires.fix
clip_skip: Clip Skip
num_gen: Number of images you want in one session
After fill in the desired parameters, run the script
You'll get images you wantIf you want to download the image, Go to Output >> /kaggle/working/t2i_images/ and click Download for the desired image in the menu on right
Or if you want all of them, run the script that starts with #@title Image ZIP and download the download.zip via Output in the menu on right
Thanks for reading this article
If you have any question, please write it on the comment