tulpa-prompter 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/tulpa-prompter.rb +33 -0
- data/lib/tulpa_prompter/version.rb +1 -1
- metadata +8 -8
- data/lib/tulpa_prompter.rb +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b58b45e75671724997df06cf5917b1b69eb85a59255b8cddce2527fe57145d4c
|
4
|
+
data.tar.gz: d3fa86d31649a3b42ec8633f8872f2fee40a807b83bd6a6d0c64492028d24444
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d4bccbae1911b6b0d9f693f597aa7a5b420344648342113f3973918b29b1f336d00c367fc499e21ae93a6c610a25288278059124ef796ecbb1cec53c01f32ba
|
7
|
+
data.tar.gz: 319423004646c27388ed2502c67ff95d6effba4813dadcf4b8f8172416e60df33ce72bb042956d07f26a731f22359385dd97e38e766b62b9faa243356d904997
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,33 @@
|
|
1
|
+
require_relative "tulpa_prompter/version"
|
2
|
+
|
3
|
+
module TulpaPrompter
|
4
|
+
class Error < StandardError; end
|
5
|
+
|
6
|
+
def self.call(options)
|
7
|
+
options[:format] ||= {}
|
8
|
+
options[:format][:frame] ||= 'integer'
|
9
|
+
|
10
|
+
options[:interval] ||= 15
|
11
|
+
options[:interval] = options[:interval].to_i
|
12
|
+
options[:lines].shuffle! if options[:shuffle].to_s.downcase == "true" || options[:shuffle].to_s == "1"
|
13
|
+
|
14
|
+
prompts = options[:lines].map.with_index do |line, index|
|
15
|
+
frame = index * options[:interval]
|
16
|
+
frame = "\"#{frame}\"" if options[:format][:frame] == 'string'
|
17
|
+
|
18
|
+
prompt = line.strip
|
19
|
+
prompt = options[:prefix].to_s + prompt + options[:suffix].to_s
|
20
|
+
prompt = prompt.gsub("\"", "\\\"")
|
21
|
+
|
22
|
+
" #{frame}: \"#{prompt}\""
|
23
|
+
end
|
24
|
+
|
25
|
+
output = ""
|
26
|
+
output << "#{options[:format][:assign]} = " if options[:format][:assign]
|
27
|
+
output << "{\n"
|
28
|
+
output << prompts.join(",\n")
|
29
|
+
output << "\n}"
|
30
|
+
|
31
|
+
output
|
32
|
+
end
|
33
|
+
end
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tulpa-prompter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dreaming Tulpa
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description:
|
13
|
+
description:
|
14
14
|
email:
|
15
15
|
- hey@dreamingtulpa.com
|
16
16
|
executables: []
|
@@ -24,7 +24,7 @@ files:
|
|
24
24
|
- Gemfile.lock
|
25
25
|
- README.md
|
26
26
|
- Rakefile
|
27
|
-
- lib/
|
27
|
+
- lib/tulpa-prompter.rb
|
28
28
|
- lib/tulpa_prompter/version.rb
|
29
29
|
- sig/prompter.rbs
|
30
30
|
homepage: https://github.com/dreamingtulpa/tulpa_prompter
|
@@ -33,7 +33,7 @@ metadata:
|
|
33
33
|
homepage_uri: https://github.com/dreamingtulpa/tulpa_prompter
|
34
34
|
source_code_uri: https://github.com/dreamingtulpa/tulpa_prompter
|
35
35
|
changelog_uri: https://github.com/dreamingtulpa/tulpa_prompter/blob/master/CHANGELOG.md
|
36
|
-
post_install_message:
|
36
|
+
post_install_message:
|
37
37
|
rdoc_options: []
|
38
38
|
require_paths:
|
39
39
|
- lib
|
@@ -48,8 +48,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: '0'
|
50
50
|
requirements: []
|
51
|
-
rubygems_version: 3.3.
|
52
|
-
signing_key:
|
51
|
+
rubygems_version: 3.0.3.1
|
52
|
+
signing_key:
|
53
53
|
specification_version: 4
|
54
54
|
summary: CLI tool to build animation prompts for AI notebooks like Deforum Stable
|
55
55
|
Diffusion
|
data/lib/tulpa_prompter.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
require_relative "tulpa_prompter/version"
|
2
|
-
|
3
|
-
module TulpaPrompter
|
4
|
-
class Error < StandardError; end
|
5
|
-
|
6
|
-
def self.call(options)
|
7
|
-
options[:interval] ||= 15
|
8
|
-
options[:lines].shuffle! if options[:shuffle]
|
9
|
-
|
10
|
-
animation_prompts = "animation_prompts = {\n"
|
11
|
-
options[:lines].each_with_index do |line, index|
|
12
|
-
frame = index * options[:interval]
|
13
|
-
prompt = line.strip
|
14
|
-
|
15
|
-
prompt = options[:prefix].to_s + prompt + options[:suffix].to_s
|
16
|
-
prompt = prompt.gsub("\"", "\\\"")
|
17
|
-
animation_prompts << " #{frame}: \"#{prompt}\",\n"
|
18
|
-
end
|
19
|
-
animation_prompts << "}"
|
20
|
-
end
|
21
|
-
end
|