harshag5 commited on
Commit
46b0b45
1 Parent(s): caeaa1f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +125 -3
README.md CHANGED
@@ -1,3 +1,125 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ ---
4
+
5
+ Experimenting with Flux finetune on Glitch Images generated using this^ Processing script I had fun with recently. WIP and doesn't enforce the style consistently but it's pretty cool.
6
+
7
+ Plays well with andreasjansson/flux-shapes (On Replicate) LoRA - also trained on synthetic data with a nice opinionated color palette.
8
+
9
+ Check the examples for trigger words etc at https://replicate.com/janghaludu/kocchaga
10
+
11
+ ^
12
+ ```
13
+ // GLITCHED Manoloide's Script
14
+ int seed = int(random(999999));
15
+
16
+ void setup() {
17
+ size(960, 960, P2D);
18
+ smooth(8);
19
+ pixelDensity(2);
20
+ generate();
21
+ }
22
+
23
+ void draw() {
24
+ generate();
25
+ }
26
+
27
+ void keyPressed() {
28
+ if (key == 's') saveImage();
29
+ else {
30
+ seed = int(random(999999));
31
+ generate();
32
+ }
33
+ }
34
+
35
+ //https://coolors.co/f2f2e8-ffe41c-ef3434-ed0076-3f9afc
36
+ int colors[] = {#155263, #FF6F3C, #FF9A3C, #FFC93C};
37
+
38
+ int rcol() {
39
+ return colors[int(random(colors.length))];
40
+ }
41
+ int getColor(float v) {
42
+ v = abs(v);
43
+ v = v%(colors.length);
44
+ int c1 = colors[int(v%colors.length)];
45
+ int c2 = colors[int((v+1)%colors.length)];
46
+ return lerpColor(c1, c2, v%1);
47
+ }
48
+
49
+ void shuffleArray(int[] array) {
50
+ for (int i = array.length; i > 1; i--) {
51
+ int j = int(random(i));
52
+ int tmp = array[j];
53
+ array[j] = array[i-1];
54
+ array[i-1] = tmp;
55
+ }
56
+ }
57
+
58
+
59
+ void generate() {
60
+ background(0);
61
+
62
+ int cc = int(random(7, random(8, 160)));
63
+ float ss = width*1./cc;
64
+
65
+ /*
66
+ noStroke();
67
+ fill(210);
68
+ rectMode(CENTER);
69
+ for (int j = 0; j < cc; j++) {
70
+ for (int i = 0; i < cc; i++) {
71
+ rect(i*ss, j*ss, 3, 3);
72
+ }
73
+ }
74
+ */
75
+
76
+
77
+ stroke(30);
78
+ noStroke();
79
+
80
+
81
+ int dx = int(random(-5, 5));
82
+ int dy = int(random(-5, 5));
83
+ for (int k = 0; k < 100; k++) {
84
+ int lar = int(random(8, random(8, 50)));
85
+ int ax = int(random(-4, cc+4));
86
+ int ay = int(random(-4, cc+4));
87
+ ArrayList<PVector> points = new ArrayList<PVector>();
88
+ for (int i = 0; i < lar; i++) {
89
+ points.add(new PVector(ax, ay));
90
+ ax += int(random(-5, 5));
91
+ ay += int(random(-5, 5));
92
+ }
93
+
94
+
95
+ int sub = int(random(1, 50));
96
+ int shw = 40;
97
+ for (int j = 0; j < sub; j++) {
98
+ beginShape();
99
+ int col = ((j%2)== 1)? 2 : (int(random(150, 250))-shw);
100
+ fill(col);
101
+ float d1 = map(j-2, 0, sub, 0, 12);
102
+ float d2 = map(j+1, 0, sub, 0, 1);
103
+ for (int i = 0; i < points.size(); i++) {
104
+ PVector p1 = points.get(i);
105
+ stroke(255-(col+(((i%2)== 0)? shw : 0)));
106
+ fill(col+(((i%2)== 0)? shw : rcol()));
107
+ vertex((p1.x+dx*d1)*ss, (p1.y+dy*d1)*ss);
108
+ }
109
+ for (int i = points.size()-1; i >=0; i--) {
110
+ PVector p1 = points.get(i);
111
+ stroke(255-(col+((((i+1)%2)== 0)? rcol() : 0)));
112
+ fill(col+((((i+1)%2)== 0)? rcol() : 0));
113
+ vertex((p1.x+dx*d2)*ss, (p1.y+dy*d2)*ss);
114
+ }
115
+ endShape(CLOSE);
116
+ }
117
+ }
118
+ }
119
+
120
+ void saveImage() {
121
+ String timestamp = year() + nf(month(), 2) + nf(day(), 2) + "-" + nf(hour(), 2) + nf(minute(), 2) + nf(second(), 2);
122
+ saveFrame(timestamp+".png");
123
+ }
124
+
125
+ ```