Views
No views yet
[trigger]
keyword = "k4s4"
[scene]
panel = 1
camera = "medium-shot"
description = "The scene depicts two characters in a heated exchange, with one character appearing visibly distressed or angry. They are engaged in a conversation, as indicated by the speech bubbles. The background is not clearly defined, suggesting an interior space, possibly a room with limited visibility of details. The shot captures both characters from a medium distance, emphasizing their expressions and the intensity of the moment."
[speech_bubbles]
count = 2
[people]
count = 2
description = "Two characters engaged in a heated exchange, one appearing visibly distressed or angry."7.50.030FlowMatchEulerDiscreteScheduler4210241import torch
2from diffusers import DiffusionPipeline
3
4model_id = 'stabilityai/stable-diffusion-3.5-medium'
5adapter_id = 'gunchoi/hwasan-toml-sd3_5_medium-1024-lora-1000'
6pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) # loading directly in bf16
7pipeline.load_lora_weights(adapter_id)
8
9prompt = "[trigger]
10keyword = "k4s4"
11
12[scene]
13panel = 1
14camera = "medium-shot"
15description = "The scene depicts two characters in a heated exchange, with one character appearing visibly distressed or angry. They are engaged in a conversation, as indicated by the speech bubbles. The background is not clearly defined, suggesting an interior space, possibly a room with limited visibility of details. The shot captures both characters from a medium distance, emphasizing their expressions and the intensity of the moment."
16
17[speech_bubbles]
18count = 2
19
20[people]
21count = 2
22description = "Two characters engaged in a heated exchange, one appearing visibly distressed or angry.""
23negative_prompt = 'blurry, cropped, ugly'
24
25## Optional: quantise the model to save on vram.
26## Note: The model was not quantised during training, so it is not necessary to quantise it during inference time.
27#from optimum.quanto import quantize, freeze, qint8
28#quantize(pipeline.transformer, weights=qint8)
29#freeze(pipeline.transformer)
30
31pipeline.to('cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu') # the pipeline is already in its target precision level
32image = pipeline(
33 prompt=prompt,
34 negative_prompt=negative_prompt,
35 num_inference_steps=30,
36 generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(42),
37 width=1024,
38 height=1024,
39 guidance_scale=7.5,
40).images[0]
41image.save("output.png", format="PNG")