Skip to content

Commit

Permalink
lora example
Browse files Browse the repository at this point in the history
  • Loading branch information
noskill committed Apr 4, 2024
1 parent 70ac55d commit 7d592eb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/prompt2im.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
["surrealism", "impressionism", "high tech", "cyberpunk"]]


pipe = Prompt2ImPipe(model_dir+model_id)
pipe = Prompt2ImPipe(model_dir+model_id, lpw=True)
pipe.setup(width=768, height=768)
gs = GenSession("./_projects/biolab", pipe, Cfgen(prompt, nprompt))
gs.gen_sess(add_count=10)
Expand Down
21 changes: 21 additions & 0 deletions examples/prompt2im_lora.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from multigen.prompting import Cfgen
from multigen.sessions import GenSession
from multigen.pipes import Prompt2ImPipe
from diffusers import DPMSolverMultistepScheduler


prompt = "digitalben is hugging his lamb, farm in background, animal photography, big sheep, full-height photo, best quality, camera low, camera close, best quality, amazing,ultra high res, masterpiece, round glasses, long hair"


negative_prompt = "deformed, distorted, disfigured, poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, (mutated hands and fingers:1.2), disconnected limbs, mutation, mutated, ugly, disgusting, blurry, amputation"


model_name = '~/models/SDXL/juggernautXL_v8Rundiffusion/'

path_lora = 'checkpoint-20500'
pipe = Prompt2ImPipe(model_name, lpw=True)
pipe.setup(width=1024, height=1024, guidance_scale=4, clip_skip=1)
pipe.load_lora(path_lora, 0.9)

gs = GenSession("./benben", pipe, Cfgen(prompt, negative_prompt, seeds=[1877029948 + i for i in range(10)]))
gs.gen_sess(add_count=10)

0 comments on commit 7d592eb

Please sign in to comment.