File size: 641 Bytes
29a5ed9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
-- Mess with the Clip encoded text - Yownas
prompt = 'cat'

p = sd.getp()
p.seed = 1234
c= sd.cond(prompt)
uc = sd.negcond('')

latent = sd.sample(p, c, uc)
ui.gallery.addc(sd.toimage(sd.vae(latent)), 'Original')

a = sd.textencode(prompt)

ui.gallery.addc(sd.toimage(a), 'Original text encode')

-- Print the tensor and size to Output
ui.out(a)
ui.out(torch.size(a))

-- Poke the encoded text (Just change one of the 77*768 numbers)
a[0][0][0] = 1.0

ui.gallery.addc(sd.toimage(a), 'Text encode after change')

c = sd.negcond2cond(sd.clip2negcond(a))
latent = sd.sample(p, c, uc)
ui.gallery.addc(sd.toimage(sd.vae(latent)), 'Poked latent')