Closed basicfeatures closed 1 year ago
I haven't used the replicate/dreambooth model directly myself, but I've added support for the experimental dreambooth endpoint.
Checkout the readme.
Regarding your error, does that one get raised on your machine or on Replicate's side? Looks to me like loading the ckpt file into your memory causes the OOM error (which wouldn't be surprising, as the file is probably 4GB+).
Coolio!
Regarding your error, does that one get raised on your machine or on Replicate's side?
The file is 2gb and I have 4gb available. I tried stuff like IO.binread("analog-diffusion-1.0.ckpt", 20)
but to no avail.
From the versions tab:
You must provide a url for ckpt_base, training starts from an existing fine-tuned checkpoint
So I guess you need to use a public url for ckpt_base
like this:
training = Replicate.client.create_training(
input: {
instance_prompt: "zwx style",
class_prompt: "style",
instance_data: upload.serving_url,
max_train_steps: 5000,
ckpt_base: 'https://domain.com/path/to/your/model.ckpt'
},
trainer_version: '9c41656f8ae2e3d2af4c1b46913d7467cd891f2c1c5f3d97f1142e876e63ed7a',
model: 'yourusername/yourmodel'
)
Haven't tested it though! Please confirm or update what works.
Not much luck so far but this approach does seem a lot more convenient than the previous:
$ ruby run_dreambooth.rb
run_dreambooth.rb:19:in `<main>': undefined method `create_upload' for #<Replicate::Client:0x00000635ee428310 @api_token="XXX", @api_endpoint="https://api.replicate.com/v1", @webhook_url=nil> (NoMethodError)
upload = Replicate.client.create_upload
^^^^^^^^^^^^^^
Did you mean? create_prediction
run_dreambooth.rb
Replicate.configure do |config|
config.api_token = "XXX"
end
upload = Replicate.client.create_upload
upload.attach("dsd.zip")
training = Replicate.client.create_training(
input: {
instance_prompt: "a photo of a dsd man",
class_prompt: "a photo of a man",
instance_data: upload.serving_url,
num_class_images: 25,
max_train_steps: 5000,
ckpt_base: "https://huggingface.co/wavymulder/Analog-Diffusion/resolve/main/analog-diffusion-1.0.ckpt"
},
trainer_version: "9c41656f8ae2e3d2af4c1b46913d7467cd891f2c1c5f3d97f1142e876e63ed7a",
model: ("replicate/dreambooth")
)
You must bundle update
, dreambooth endpoint has been added with gem version 0.2. Also just pushed a new helper method which makes uploading a zip file easier:
upload = Replicate.client.upload_zip('path/to/file.zip')
... is enough now. No need to call #attach
anymore.
Not getting any errors, but nothing shows up at https://replicate.com/predictions:
require "replicate"
# gem install --user-install specific_install
# gem git_install --user-install https://github.com/dreamingtulpa/replicate-ruby
Replicate.configure do |config|
config.api_token = "XXX"
end
upload = Replicate.client.upload_zip("dsd.zip")
training = Replicate.client.create_training(
input: {
instance_prompt: "a photo of a dsd man",
class_prompt: "a photo of a man",
instance_data: upload.serving_url,
num_class_images: 25,
max_train_steps: 5000,
ckpt_base: "https://huggingface.co/wavymulder/Analog-Diffusion/resolve/main/analog-diffusion-1.0.ckpt"
},
trainer_version: "9c41656f8ae2e3d2af4c1b46913d7467cd891f2c1c5f3d97f1142e876e63ed7a",
model: ("replicate/dreambooth")
)
puts "Check status at https://replicate.com/predictions..."
The model
parameter is wrong, needs to be yourusername/yourmodelname
.
So I missed the most essential part 🤣
This Cog/Docker stuff is mad confusing though.
I'd say this one is safe to close. Thanks a bunch for the help!
Any clues what to do? Cheers!
run_dreambooth.rb